phpexcel 为何无法创建xlsx文件

180it 2021-12-20 PM 1523℃ 0条
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="fee_detail.xlsx"');
header('Cache-Control: max-age=0');
 
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
$objWriter->save( 'php://output');

为何无法创建xlsx文件。

header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="fee_detail.xls"');
header('Cache-Control: max-age=0');
 
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('php://output');

可以创建xls文件。

支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

phpexcel 为何无法创建xlsx文件