fgetcsv
fgetcsv fails to read line ending in mac formatted csv file, any better solution?
Setting auto_detect_line_endings is explicitly recommended by the php documentation. However, I cannot fathom why you would want to delimit lines with \r in 2010. If possible, convert them to the UNIX-style \n.
How to parse a CSV file using PHP [duplicate]
Just use the function for parsing a CSV file http://php.net/manual/en/function.fgetcsv.php $row = 1; if (($handle = fopen(“test.csv”, “r”)) !== FALSE) { while (($data = fgetcsv($handle, 1000, “,”)) !== FALSE) { $num = count($data); echo “<p> $num fields in line $row: <br /></p>\n”; $row++; for ($c=0; $c < $num; $c++) { echo $data[$c] . “<br />\n”; … Read more