SheppardDigital
asked on
getscsv won't detect new lines in CSV
Hi there,
I've attached a bit of code that I'm using the convert a CSV file to an array. The problem is, I've generated a CSV file on a Mac and the script won't detect new lines in the file.
I've tried setting
ini_set('auto_detect_line_ endings',t rue);
but it didn't make any difference.
Does anyone have any ideas?
I've attached a bit of code that I'm using the convert a CSV file to an array. The problem is, I've generated a CSV file on a Mac and the script won't detect new lines in the file.
I've tried setting
ini_set('auto_detect_line_
but it didn't make any difference.
Does anyone have any ideas?
$row = 0;
if (($handle = fopen($filename, "r")) !== FALSE) {
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$rows[] = $data;
}
fclose($handle);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.