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
精彩评论