开发者

PHP How to retrieve first line of a .CSV as a string?

How do I retrieve the first line of a .CSV file as a string?

This current method I am using is failing to return the first line, but is instead returning the second line:

$content 开发者_高级运维= file($filepath);
echo $content[0];


fgets() can be used to read a single line from a file.


This function will work better for you: fgetcsv()

But on a large files and if you need the performance use this function: http://ca2.php.net/manual/en/function.fgets.php

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜