雖然谷歌搜索我發現兩組不同需要被設定時輸出高強不同的文件格式生成的報頭。PHPExcel設置特定的標頭文件格式
爲例如
對於類型 「Excel5」標題是:
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");;
header("Content-Disposition: attachment;filename=$filename");
header("Content-Transfer-Encoding: binary ");
對於類型 「Excel2007的」標題是:
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="myfile.xlsx"');
header('Cache-Control: max-age=0');
我的問題:是否有需要設立不同的頁眉每種文件類型爲有其他類型的文件也CSV,HTML和PDF?