在header() 前面加上ob_end_clean() 函数, 清除缓冲区, 这样就不会乱码了!
ob_end_clean();//清除缓冲区,避免乱码
header('Content-Type: application/vnd.ms-excel');
.....
.....
使用phpexcel导出excel乱码问题解决方法
最新推荐文章于 2021-03-18 02:51:38 发布
在header() 前面加上ob_end_clean() 函数, 清除缓冲区, 这样就不会乱码了!
ob_end_clean();//清除缓冲区,避免乱码
header('Content-Type: application/vnd.ms-excel');
.....
.....