-
PHP 使用header函数设置HTTP头的示例方法 表头(转)
-
- header( 'Content-Type:text/html;charset=utf-8 ');
-
-
- header('Content-type: application/atom+xml');
-
-
- header('Content-type: text/css');
-
-
- header('Content-type: text/javascript');
-
-
- header('Content-type: image/jpeg');
-
-
- header('Content-type: application/json');
-
-
- header('Content-type: application/pdf');
-
-
- header('Content-Type: application/rss+xml; charset=ISO-8859-1');
-
-
- header('Content-type: text/plain');
-
-
- header('Content-type: text/xml');
-
-
- header('HTTP/1.1 200 OK');
-
-
- header('HTTP/1.1 404 Not Found');
-
-
- header('HTTP/1.1 301 Moved Permanently');
-
-
- header('Location: http://www.example.org/');
-
-
- header('Refresh: 10; url=http://www.example.org/');
- print 'You will be redirected in 10 seconds';
-
-
-
-
-
- header('X-Powered-By: PHP/4.4.0');
- header('X-Powered-By: Brain/0.6b');
-
-
- header('Content-language: en');
-
-
- $time = time() - 60;
- header('Last-Modified: '.gmdate('D, d M Y H:i:s', $time).' GMT');
-
-
- header('HTTP/1.1 304 Not Modified');
-
-
- header('Content-Length: 1234');
-
-
- header('Content-Type: application/octet-stream');
- header('Content-Disposition: attachment; filename="example.zip"');
- header('Content-Transfer-Encoding: binary');
-
- readfile('example.zip');
-
-
- header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate');
- header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
- header('Pragma: no-cache');
-
-
- header('Content-Type: text/html; charset=iso-8859-1');
- header('Content-Type: text/html; charset=utf-8');
- header('Content-Type: text/plain');
- header('Content-Type: image/jpeg');
- header('Content-Type: application/zip');
- header('Content-Type: application/pdf');
- header('Content-Type: audio/mpeg');
- header('Content-Type: application/x-shockw**e-flash');
-
-
- header('HTTP/1.1 401 Unauthorized');
- header('WWW-Authenticate: Basic realm="Top Secret"');
- print 'Text that will be displayed if the user hits cancel or ';
- print 'enters wrong login data';
-
相关阅读:
一行代码轻松修改 Text Field 和 Text View 的光标颜色 — By 昉
六种手势识别,你用了哪些?——董鑫
Mac 屏幕录制Gif 制作 By-胡罗
利用ICMP协议的PING命令获取客户端当前网络质量 by徐文棋
iOS加载Gif图片的N种方式 By-H罗
[手游项目3]-10-Go语言atomic原子操作
[手游项目3]-9-Go语言sync.Map(在并发环境中使用的map)
LRU原理和Redis实现
Cleanup failed to process the following paths错误的解决
[手游项目3]-8-排行榜redis实现
-
原文地址:https://www.cnblogs.com/xingmeng/p/3069223.html
Copyright © 2020-2023
润新知