升级到php7之后phpexcel导出excel出现此问题,在php5环境下可以导出。
立即学习“PHP免费学习笔记(深入)”;
86CMS企业网站系统为智能ASP网站管理程序,适合中小企业自建网站、二次开发使用。本程序具有体积小巧、程序文件结构严谨、界面清爽简单、功能强大、非专业人士使用入门快、中小企业使用投资小等实用特点。本版本为中英繁版本。86CMS企业网站系统中英繁三语版 v1.2 更新1.修正英文版的flash幻灯调用出错问题。2.修正英文版导航菜单设置出错问题。3.增加信息是否显示在中英各版的功能。4.调整首页视
4
code:
$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control:must-revalidate, post-check=0, pre-check=0");
header("Content-Type:application/vnd.ms-execl");
header('Content-Disposition:attachment;filename="xxx.xls"');
header("Content-Transfer-Encoding:binary");
$objWriter->save('php://output');升级到php7之后phpexcel导出excel出现此问题,在php5环境下可以导出。
立即学习“PHP免费学习笔记(深入)”;
code:
$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);
header("Pragma: public");
header("Expires: 0");
header("Cache-Control:must-revalidate, post-check=0, pre-check=0");
header("Content-Type:application/vnd.ms-execl");
header('Content-Disposition:attachment;filename="xxx.xls"');
header("Content-Transfer-Encoding:binary");
$objWriter->save('php://output');
错误提示:
Fatal error: 'break' not in the 'loop' or 'switch' context in Function.php
这是1.8版本运行在php7上存在的一个Bug,将phpexcel升级至1.8.1就可以了。
github的issue有没有碰到过跟你一样的问题的人,或者stackoverflow搜一下。我用过5下的execl没用过7的
全网最新最细最实用WPS零基础入门到精通全套教程!带你真正掌握WPS办公! 内含Excel基础操作、函数设计、数据透视表等
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号