开发者

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";
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜