Rumah  >  Artikel  >  pembangunan bahagian belakang  >  PHP导出xls问题

PHP导出xls问题

WBOY
WBOYasal
2016-06-23 13:42:23862semak imbas

<?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");  

借别人的代码

Kenyataan:
Kandungan artikel ini disumbangkan secara sukarela oleh netizen, dan hak cipta adalah milik pengarang asal. Laman web ini tidak memikul tanggungjawab undang-undang yang sepadan. Jika anda menemui sebarang kandungan yang disyaki plagiarisme atau pelanggaran, sila hubungi admin@php.cn