note 78251 added to function.fgetcsv
| From: | TimHenderson at osu1 dot php dot net | Date: | Thu, 04 Oct 2007 13:40:08 +0000 |
| Subject: | note 78251 added to function.fgetcsv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-131077@lists.php.net to get a copy of this message | ||
Only problem with fgetcsv(), at least in PHP 4.x -- any stray slash in the data that happens to come
before a double-quote delimiter will break it -- ie, cause the field delimiter to be escaped. I
can't find a direct way to deal with it, since fgetcsv() doesn't give you a chance to
manipulate the line before it reads it and parses it...I've had to change all occurrences of
'\"' to '" in the file first before feeding ot to fgetcsv(). Otherwise this
is perfect for that Microsoft-CSV formula, deals gracefully with all the issues.
----
Server IP: 217.160.72.57
Probable Submitter: 209.220.106.22
----
Manual Page -- http://www.php.net/manual/en/function.fgetcsv.php
Edit -- https://master.php.net/note/edit/78251
Del: integrated -- https://master.php.net/note/delete/78251/integrated
Del: useless -- https://master.php.net/note/delete/78251/useless
Del: bad code -- https://master.php.net/note/delete/78251/bad+code
Del: spam -- https://master.php.net/note/delete/78251/spam
Del: non-english -- https://master.php.net/note/delete/78251/non-english
Del: in docs -- https://master.php.net/note/delete/78251/in+docs
Del: other reasons-- https://master.php.net/note/delete/78251
Reject -- https://master.php.net/note/reject/78251
Search -- https://master.php.net/manage/user-notes.php