LoginSignup
0
0

More than 3 years have passed since last update.

phpspreadsheet 保存csv日语乱码的问题

Posted at

//保存するファイルのファイルポインタを開く
$fp = fopen('/var/www/html/laravel/public/'.$file_name, "w");

//fputcsvでCSVデータを作る
foreach ($sheet->toArray() as $val) {mb_convert_variables('SJIS-win', 'UTF-8', $val);fputcsv($fp, $val);}

//ファイルポインタを閉じる
fclose($fp);

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0