I am converting csv file to an array using code bellow. But, problem is that end of the row is CR LF, and it is not detected, so array has wrong offset. CR
Have you tried using fgetcsv()? full info on php.net.
fgetcsv()
Example usage from php.net
$num fields in line $row: \n"; $row++; for ($c=0; $c < $num; $c++) { echo $data[$c] . "\n"; } } fclose($handle); } ?>