我一直试图在PHP中以excel格式保存html数据(基本上导出为excel功能)。我通过将标题更改为如何在Excel中保存html表格
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$filename");
header("Pragma: no-cache");
header("Expires: 0");
但是,在打开文件时,它显示了上述Excel 2003应用程序的警告。所以,我可以通过修改标题来保存2008或2010格式的Excel,还是必须去提供像“PHPExcel”之类的其他框架。是的,我使用CodeIgniter为我的网站
在此先感谢。
http://stackoverflow.com/questions/2937465/what-is-correct-content-type-for- excel文件我认为它只是使用适当的内容类型 – tomexsans