热搜:NVER node 开发 php

PHP导出xls问题

2024-08-14 15:45:01
PHP导出xls问题

<?header("Content-type:application/vnd.ms-excel");header("Content-Disposition:filename=test.xls");echo "test1 ";echo "test2";echo "test1";echo "test2";echo "test1";echo "test2";echo "test1";echo "test2";echo "test1";echo "test2";echo "test1";echo "test2";?>


为什么我运行了上面代码 不会下载??


回复讨论(解决方案)

少了点东西,大小和什么东西吧、

 header("Content-type:application/octet-stream");    header("Accept-Ranges:bytes");    header("Content-type:application/vnd.ms-excel");      header("Content-Disposition:attachment;filename=".$filename.".xls");    header("Pragma: no-cache");    header("Expires: 0");

header("Content-Type: application/force-download");  
header("Content-Type: application/octet-stream");  
header("Content-Type: application/download");  
header('Content-Disposition:inline;filename="'.$FileName.'"');  
header("Content-Transfer-Encoding: binary");  
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");  
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");  
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");  
header("Pragma: no-cache");  

借别人的代码