In my application I'm generating a csv file with some data using php. My code looks like shown below.
$fileHandle = fopen('test.csv', "w");
$list = array (
array('aaa;cc;kk;', 'bbb', 'ccc', 'dddd'),
array('123', '456', '789'),
array('"aaa"', '"bbb"')
);
foreach ($list as $fields) {
fputcsv($fileHandle, $fields);
}
fclose($fileHandle);
The data aaa;cc;kk;
is written to separate cells (1st cell contains aaa, 2nd cell contains cc) instead of writing it to a single cell.
In the documentation, it is mentioned that, by default delimiter is comma. Why this values are getting separated with semicolon? How can I avoid that?
Thanks in advance.