PHP中经常韩国主播徐雅seo工具-使用的header头部界说有哪些
PHP中的header() 函数用于背客户端收收本初的 HTTP 报头,明天将为年夜家分享一些正在PHP中经常使用的header函数头具备必然的参考代价,但愿对于年夜家有所帮忙。
header('HTTP/1.1 200 OK'); // ok 一般拜候
header('HTTP/1.1 404 Not Found'); //告诉阅读器 页里找不到
站长工具分析异常
header('HTTP/1.1 301 Moved Permanently'); //配置地点被永远的重定背 301
header('Location: http://bbs.52jscn.com/'); //跳转到一个最新的地点
header('Refresh: 10; url=http://bbs.52jscn.com/'); //提早转背 也便是隔多少秒跳转
header('X-Powered-By: PHP/6.0.0'); //点窜 X-Powered-By疑息
header('Content-language: en'); //文档说话
header('Content-Length: 1234'); //配置文章少度
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT'); //告知阅读器最初一次点窜时候
header('HTTP/1.1 304 Not Modified'); //告知阅读器文档文章出有产生改动
暗示文章范例
header('Content-Type: text/html; charset=utf-8'); //html页面编码
header('Content-Type: text/plain'); //杂文本格局
header('Content-Type: image/jpeg'); //JPG、JPEG
header('Content-Type: application/zip'); // ZIP文件
header('Content-Type: application/pdf'); // PDF文件
header('Content-Type: audio/mpeg'); // 音频文件
header('Content-type: text/css'); //css文件
header('Content-type: text/javascript'); //js文件
header('Content-type: application/json'); //json
header('Content-type: application/pdf'); //pdf
header('Content-type: text/xml'); //xml
header('Content-Type: application/x-shockw**e-flash'); //Flash动
申明一个下载的文件
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="ITblog.zip"');
header('Content-Transfer-Encodin百度站长工具如何注册g: binary');
readfile('test.zip');
对于以后文档禁用缓存
h站长工具内容页流量查询eader('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
显现一个要求考证的登岸对于话框
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic realm="Top Secret"');
申明一个要求下载的xls文件
header('Content-Disposition: attachment;百度站长工具站点 filename=ithhc.xlsx');
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Length: '.filesize('./test.xls'));
header('Content-Transfer-Encoding: binary');
header('Cache-Control: must-revalidate');
header('Pragma: public');
readfile('./test.xls');
以上便是PHP中经常使用的header头部界说有哪些的具体文章,更多请存眷锦尚中国别的有关文章!