php 如何导出xlsx,可以导出xls,但xlsx导出后就无法打开,请帮忙看看

2025-05-16 17:23:46
推荐回答(4个)
回答(1):

 header('Content-Type: application/vnd.ms-excel');
这样试试

回答(2):

表示以前研究过,但是..

回答(3):

把$file_type修改为

$file_type = "vnd.openxmlformats-officedocument.spreadsheetml.sheet
"

回答(4):

header('Content-Encoding: none');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename=111.csv');
header('Pragma: no-cache');
header('Expires: 0');
echo "11,22\n1111,3333";