[PHP-DEV] Function Request: csv_explode()

2001-11-29 Thread Justin Plock
I guess this would be the correct list to post this on, but I have an idea for a function that I think would be very handy to users having to deal with CSV data. Basically, I've had to write a version of the explode() function, but have it pay attention to values that are wrapped in another charac

Re: [PHP-DEV] Function Request: csv_explode()

2001-12-05 Thread Stig S. Bakken
Splitting a CSV string into an array could be done like this too: $fields = explode('","', trim($string, '"')); - Stig Justin Plock wrote: > > I guess this would be the correct list to post this on, but I have an idea > for a function that I think would be very handy to users having to deal w

Re: [PHP-DEV] Function Request: csv_explode()

2001-12-05 Thread Edin Kadribasic
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

Re: [PHP-DEV] Function Request: csv_explode()

2001-12-06 Thread Zak Greant
On December 5, 2001 01:29 am, Stig S. Bakken wrote: > Splitting a CSV string into an array could be done like this too: > > $fields = explode('","', trim($string, '"')); Hey Stig, I don't think that it is quite that simple. :) The sample code will break for unquoted values and weird