- Fix BOM Office
This commit is contained in:
parent
7166ce82f4
commit
069c080b43
1 changed files with 2 additions and 0 deletions
|
|
@ -149,6 +149,7 @@ class EleveurController extends Controller
|
|||
|
||||
public function export(){
|
||||
$headers = array(
|
||||
"Content-Encoding" => "UTF-8",
|
||||
"Content-type" => "Content-type: text/csv; charset=UTF-8",
|
||||
"Content-Disposition" => "attachment; filename=file.csv",
|
||||
"Pragma" => "no-cache",
|
||||
|
|
@ -162,6 +163,7 @@ class EleveurController extends Controller
|
|||
$callback = function() use ($eleveurs, $columns)
|
||||
{
|
||||
$file = fopen('php://output', 'w');
|
||||
fputs($file, "\xEF\xBB\xBF"); // use BOM for Office
|
||||
fputcsv($file, $columns, ";");
|
||||
|
||||
foreach($eleveurs as $eleveur) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue