note 51141 added to function.fgetcsv
| From: | basslines at gmail dot com | Date: | Mon, 21 Mar 2005 17:16:27 +0000 |
| Subject: | note 51141 added to function.fgetcsv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-86752@lists.php.net to get a copy of this message | ||
fgetcsv does not work properly if a field is equal to the escape character. For example: the
following CSV:
"Path","Name","Age"
"\","Bob","12"
"None","Billy","24"
would return"
[0] => Path
[1] => Name
[2] => Age
[0] => \",Bob"
[1] => 12
[0] => None
[1] => Billy
[2] => 24
So far the only way I've found to get around this it by pre-processing your CSV file to either
remove them or double slash them, which would give you double slashes in your results.
----
Manual Page -- http://www.php.net/manual/en/function.fgetcsv.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51141
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51141&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51141&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51141&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51141&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51141&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51141&report=yes
Search -- http://master.php.net/manage/user-notes.php