0
$spacer = "\t"; $eol = "\n"; // en-tete, par exemple... $csv_output = "Date $spacer"."Journal $spacer"."Pièce $spacer"."Libéllé de l'ecriture $spacer"."Compte $spacer"."Intitulé $spacer"."Débit $spacer"."Crédit $spacer"."Code analytique \n"; // générer un CSV, par exemple... $csv_output.= "$date $spacer"."$journal $spacer"."$piece $spacer"."$ecriture $spacer"."$compte $spacer"."$intitule $spacer"."$debit $spacer"."$credit $spacer".$analytique." \n"; $date = date('Y-m-d_H\hi'); $encoded_csv = mb_convert_encoding($csv_output, 'UTF-16LE', 'UTF-8'); header('Content-Description: File Transfer'); header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment; filename="journal_ventes_italic_'.$date.'.csv"'); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: '. strlen($encoded_csv)); echo chr(255) . chr(254) . $encoded_csv; exit;
DATE 29 Mar 2014