PHP Strange behaviour of foreach
I've a code:
开发者_高级运维$csv = file('some.csv');
foreach($csv as $value)
{
echo $value;
}
Everything is OK until the request method was POST - then the last element of an array is missing (thought it's showing properly by print_r($csv)).
What may the problem be? That's the WHOLE CODE!
Try it:
$csv = file('some.csv');
// Loop through our array
foreach ($cvs as $line_num => $line) {
echo $line."<br />\n";
}
精彩评论