乐心
Always dream. Always explore.
乐心的博客
php导出csv打开乱码问题解决
$transaction_excel_fp = fopen($transaction_excel_path, 'w');
fwrite($transaction_excel_fp,chr(0xEF).chr(0xBB).chr(0xBF));
fputcsv($cashback_excel_fp, [
    'aaa',
    'bbb',
]);
fclose($cashback_excel_fp);

//顺带一个知识点 csv处理成纯文本显示

protected function convertNumberToStringForExcel($value)
{
    return '=("' . $value . '")';
}
如果喜欢这篇文章,欢迎推荐给你的朋友

推荐文章

发表评论

textsms
account_circle
email

乐心的博客

php导出csv打开乱码问题解决
$transaction_excel_fp = fopen($transaction_excel_path, 'w'); fwrite($transaction_excel_fp,chr(0xEF).chr(0xBB).chr(0xBF)); fputcsv($cashback_excel_fp, [ 'aaa', 'bbb', …
扫描二维码继续阅读
2018-02-06