php設置響應頭
1、設置響應頭文件類型
<?php
header('Content-Type:text/css;charset=GBK');//css文件類型,GBK編碼
header('Content-Type:text/html;charset=UTF-8');//html文件類型,UTF-8類型
header('Content-Type:text/plain');//純文件類型,不會做任何解析
header('Content-Type:applcation/javascript');//javascript文件類型
?>2、重定向(跳轉到其它網頁)
header('Location:https://www.baidu.com');//跳轉到百度網頁
?>3、下載文件
<?php
header('Content-Type:application/octet-stream');//設置文件下載
header('Content-Disposition:attachment;filename=dome.txt');
?>