首頁  >  文章  >  後端開發  >  PHP导出xls问题

PHP导出xls问题

WBOY
WBOY原創
2016-06-23 13:42:23863瀏覽

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

借别人的代码

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn