Answer the question
In order to leave comments, you need to log in
How to create a different separator when creating a CSV?
An extract is generated from the server into a CSV file. But by default, the separator is a comma.
How can I change it to a semicolon. Found in the documentation:
foreach ($list as $line) {
fputcsv($fp, split(';', $line));
}
foreach ($arrayData as $fields) {
fputcsv($fp, $fields);
}
fclose($fp);
Array
(
[0] => Array
(
[id] => 0-1
[title] => 0-2
[h1] => 0-3
)
[1] => Array
(
(
[id] => 1-1
[title] =>1-2
[h1] => 1-3
)
)
Answer the question
In order to leave comments, you need to log in
Looked
bad id1.php.net/manual/ru/function.fputcsv.php
int fputcsv ( resource $handle , array $fields [, string $delimiter = "," [, string $enclosure = '"' [, string $escape_char = "\" ]]] )fputcsv($fp, $fields, ';');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question