Answer the question
In order to leave comments, you need to log in
Why when saving to csv (using php) quotes are replaced with " How to fix it?
I save the data in the csv file, in the name field there are double quotes "but they are replaced by" , how to fix it?
With the help of fputcsv the same problem.
The code is extremely simple
public function getcsv($array, $filename = "export.csv", $delimiter=";") {
header('Content-Type: application/csv');
header('Content-Disposition: attachment; filename="'.$filename.'";');
foreach ($array as $line) {
echo $line['order_id'].';'.$line['model'].';'.$line['quantity'].';'.$line['price'].';'.$line['skidka'].';'.$line['shipping'].';'. $line['name']."\n";
}
}
Answer the question
In order to leave comments, you need to log in
in the field $line['name'] - there is the name of the product OGONEK. COLLECTION "HOUSE"
in csv turns out like this FIRE. COLLECTION "HOUSE"
What is the difference? Didn't see it with my eyes...
apparently not to be skipped here & quot; replaces
FLIGHT with quotation marks. COLLECTION " HOUSE" - added spaces
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question