note 91306 added to function.str-getcsv
| From: | dave_walter at yahoo dot com | Date: | Thu, 04 Jun 2009 16:51:20 +0000 |
| Subject: | note 91306 added to function.str-getcsv | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-156371@lists.php.net to get a copy of this message | ||
Just to clarify, my str_putcsv() function was only ever designed to complement the functionality of
the str_getcsv() built-in function, which can only handle converting one line of input into a single
level array. For example, this code:
<?php
var_dump( str_getcsv( "a,b,c\nd,e,f", "," ));
?>
generates this output:
array(5) {
[0]=>
string(1) "a"
[1]=>
string(1) "b"
[2]=>
string(3) "c
d"
[3]=>
string(1) "e"
[4]=>
string(1) "f"
}
Even fgetcsv() and fputcsv() only work with a single line. All the examples show them being used
within a loop of some sort.
I was also avoiding the artificial restriction on the length of the CSV string introduced by
Ulf's modification.
----
Server IP: 209.41.74.194
Probable Submitter: 67.130.135.29
----
Manual Page -- http://www.php.net/manual/en/function.str-getcsv.php
Edit -- https://master.php.net/note/edit/91306
Del: integrated -- https://master.php.net/note/delete/91306/integrated
Del: useless -- https://master.php.net/note/delete/91306/useless
Del: bad code -- https://master.php.net/note/delete/91306/bad+code
Del: spam -- https://master.php.net/note/delete/91306/spam
Del: non-english -- https://master.php.net/note/delete/91306/non-english
Del: in docs -- https://master.php.net/note/delete/91306/in+docs
Del: other reasons-- https://master.php.net/note/delete/91306
Reject -- https://master.php.net/note/reject/91306
Search -- https://master.php.net/manage/user-notes.php