Link to home
Start Free TrialLog in
Avatar of SheppardDigital
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',true);
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);
				}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Scott Madeira
Scott Madeira
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial