Hi,
Just to add some information in case you're not already aware of it - double quotes (") are used when the text they encapsulate might contain one or more instances of the value delimiter (usually a comma, but not always). Some applications automatically output every value in double quotes when it isn't strictly necessary though, but applications like Excel usually work correctly because it knows what data types it's using for each cell.
Rather than using trim(), you might be better to use str_replace() instead:
Code: Select all
$text = 'Here is "some text" with "double quotes" in it';
echo str_replace('"', '', $text);
This will work on the whole string, not just the beginning and end of it. If you need to remove other non-standard characters that you don't want saved in your database records, you can also use preg_replace() to convert multiple dashes (---) to a single one (-), convert ampersands (&) to "and", etc.
Don't forget that PHP also has functions available to directly parse/output CSV files, and you can also change the default delimiter and boundary characters settings if necessary.
HTH,
Mecha Godzilla