note 53396 deleted from function.fgetcsv by nlopess
| From: | nlopess@php.net | Date: | Tue, 31 May 2005 17:52:52 +0000 |
| Subject: | note 53396 deleted from function.fgetcsv by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-89693@lists.php.net to get a copy of this message | ||
Note Submitter: phillip at vanessen - online dot de
----
Found a mystic thing within fgetcsv function.
Code:
<?php
$csvfile = fopen('foo.csv','r'); // content of foo.csv -> look further down.
$testarray = fgetcsv($csvfile,1000,";");
print_r($testarray);
?>
Content of foo.csv:
foo bar;foo "bar";"foo" bar;"foo bar"
Expected output of code:
Array
(
[0] => foo bar
[1] => foo "bar"
[2] => "foo" bar
[3] => "foo bar"
)
Effective output of code:
Array
(
[0] => foo bar
[1] => foo "bar"
[2] => foo bar
[3] => foo bar
)
It seems as if fgetcsv does not recognize data starting with quotes.
Is this "working as designed"??
Brgds,
Phillip