// ok
header('HTTP/1.1 200 OK');
//设置一个 404 头:
header('HTTP/1.1 404 Not Found');
//
设置地址被永久的重定向
header('HTTP/1.1 301 Moved Permanently');
//
转到一个新地址
header('Location: ');
//文件延迟转向:
header('Refresh: 10; url=);
'You will be redirected in 10 seconds';
//当然,也可以使用 html
语法实现
// <meta http-equiv="refresh" content="10;>
// override X-Powered-By: PHP:
header('X-Powered-By: PHP/4.4.0');
header('X-Powered-By: Brain/0.6b');
//
文档语言
header('Content-language: en');
//
告诉浏览器最后一次修改时间
$time
= time() - 60;
// or filemtime($fn), etc
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"');