I have the following code :
header('Content-Encoding: UTF-8');
header("Content-Type:application/csv;charset=UTF-8");
header('Content-Disposition: attachement; filename="' . $sFileName . '";');
header("Pragma: no-cache");
header("Expires: 0");
header("Refresh:0");
echo "\xEF\xBB\xBF";
$output = fopen('php://output', 'w');
fwrite($output, "sep=;\n");
fputcsv($output, array('1','2','3'), ";");
foreach ($aExport as $value) {
fputcsv($output, $value, ";");
}
fpassthru($output);
fclose($output);
exit;
For example if I have multiples 0000 witch need to be put in the first column it truncate the rest and it put only one zero. I dont'n understand why. Can you help me please ? Thx in advance