excel utf 8 php

Solutions on MaxInterview for excel utf 8 php by the best coders in the world

showing results for - "excel utf 8 php"
Sami
01 Jul 2020
1// --- 3 rows for encoding utf-8
2header('Content-Encoding: UTF-8'); // vilh, change to UTF-8!
3header("Content-type: application/x-msexcel; charset=utf-8");  // vilh, chang
4fputs ($fp, "\xEF\xBB\xBF"); // vilh, change to UTF-8!
5
6// -------------------
7header('Content-Encoding: UTF-8'); // vilh, change to UTF-8!
8header("Content-type: application/x-msexcel; charset=utf-8");  // vilh, change to UTF-8!
9header('Content-Disposition: attachment; filename="'.$fileName.'.csv"');
10header('Cache-Control: max-age=0');
11
12// for browser down
13$fp = fopen('php://output', 'a');
14
15fputs ($fp, "\xEF\xBB\xBF"); // vilh, change to UTF-8!
16
17//header
18foreach ($headlist as $key => $value) {
19  $headlist[$key] = $value;	// vilh, change to UTF-8
20}
21
22fputcsv($fp, $headlist);
Frida
27 Nov 2019
1mb_convert_encoding($csv, 'UTF-16LE', 'UTF-8');
Amanda
03 Jan 2021
1chr(255) . chr(254)