On Wed, 5 Dec 2001, Stig S. Bakken wrote:
> Splitting a CSV string into an array could be done like this too:
>
> $fields = explode('","', trim($string, '"'));
I've had problems with CSV files exported from Excel that does not quote
all fields, escapes double quotes with double quotes and puts newlines in
the middle of a field:
45,"Test ""field"",
with several lines"
This should be decoded as a two field record:
45
Test \"field\",\nwith several lines
So a I'm afraid that a simple split() wouldn't be able to cope with all
that.
Edin
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]