更新时间:2023-02-04 22:00:54
在使用文件扩展名.xlsx命名文件时,将其放在底部附近,这是Office 2007中基于openxml的文档的正确文件扩展名,可以解决您的问题.>
Near the bottom when you name the file use file extension .xlsx it is the proper file extension for openxml based documents from office 2007 should fix your issue.
header('Content-Disposition: attachment;filename="survey.xlsx"');
如果您绝对需要使用xls将输出类型更改为Excel2003,但是还需要更改内容类型标头以使其匹配.
If you absolutely need to use xls change the output type to Excel2003 but then you need to change the content type header to match that as well.