View Single Post
Old 10-30-2009, 11:59 AM   #4 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Quote:
Originally Posted by Dave View Post
The file contains a name field, i.e., "Doe, John" (with comma).
Maybe I missed it, but what's the problem? CSV fields can contain commas if they are enclosed in quotes (or some other defined character).

PHP Code:
print_r(str_getcsv('foo,"bar,baz"'));
/*
Array
(
    [0] => foo
    [1] => bar,baz
)
*/ 
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
Dave (10-30-2009)