note 24148 added to function.fgetcsv
| From: | justin@php.net | Date: | Thu, 08 Aug 2002 04:24:53 +0000 |
| Subject: | note 24148 added to function.fgetcsv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-34505@lists.php.net to get a copy of this message | ||
If you're working in Excel on a Mac and are exporting a spreadsheet as a CSV, PHP won't
recognise the line breaks, and interprets the file as one really long line. It borders on a bug
really. For me, I just open the file in BBEdit or BBEdit Lite, convert the file from Mac to Unix,
and all is well. But if you're dealing with user-contributed files, you'll need to
convert the line-endings first... replacing all \r's with \n's should do it.
--
http://www.php.net/manual/en/function.fgetcsv.php
http://master.php.net/manage/user-notes.php?action=edit+24148
http://master.php.net/manage/user-notes.php?action=delete+24148
http://master.php.net/manage/user-notes.php?action=reject+24148