Problem with a CSV import

Associate
Joined
13 Nov 2003
Posts
1,567
Location
Manchester
Hi All

Trying to import a large amount of data via a csv file in php.

However, the file in question seems to be both a coma seperated and tab delimited. Any ideas how to modify the code below to deal with that?

Code:
$file[] = explode('","', trim($line, '"'));

At the moment it does seperate the fields correctly, but it adds loads of white spae into the database fields.

Any help is appreciated
Aaron
 
Back
Top Bottom