Hello,
I would like to know if someone can help me with this:
I have .csv file (semi-colon delimited) that has 5 columns with data being written to it from a user-submitted form and some of the fields have double quotation marks (") around them after the data file has been written to, the fields being $ip and $today
For example, the first 3 fields have no quotation marks, but the last two do:
Bob;Barker;bob@barker.com;"209.255.255.122";"26 Jan 2011 05:11 AM"
Is there a way to stop the quotation marks from being processed before the data gets written to the file?
Here is the code that is executed once the form has been submitted:
----------------------------------------
$list = array (
array($name, $lname, $email, $ip, $today)
);
$fp = fopen('/home/public_html/cgi-bin/data/file.txt', 'a+');
foreach ($list as $fields) {
fputcsv($fp, $fields, $delimiter = ';');
$fp= str_replace('"', "", $fp); < that didn't work for me
}
fclose($fp);
----------------------------------------
Thank you