header
(PHP 3, PHP 4 )header -- Send a raw HTTP header
Description
int header ( string string [, bool replace [, int http_response_code]])
header() is used to send raw HTTP headers. See the HTTP/1.1 specification for more information on HTTP headers. The optional replace parameter indicates whether the header should replace a previous similar header, or add a second header of the same type. By default it will replace, but if you pass in FALSE as the second argument you can force multiple headers of the same type. 自己查一下手册,上面有详细的解释
(PHP 3, PHP 4 )header -- Send a raw HTTP header
Description
int header ( string string [, bool replace [, int http_response_code]])
header() is used to send raw HTTP headers. See the HTTP/1.1 specification for more information on HTTP headers. The optional replace parameter indicates whether the header should replace a previous similar header, or add a second header of the same type. By default it will replace, but if you pass in FALSE as the second argument you can force multiple headers of the same type. 自己查一下手册,上面有详细的解释
他有各种信息,有告诉浏览器准备接受email,上传文件,html文挡的各种消息,还有用的协议等,甚至可以让用户输入密码,我们通过一般书籍只能了解他的大概,如果您要了解更多,只能去k一些国外的专业工具书了!
注意: 传统的标头一定包含下面三种标头之一,并只能出现一次。
Content-Type: xxxx/yyyy
Location: xxxx:yyyy/zzzz
Status: nnn xxxxxx
范例一: 本例用来重导用户到 PHP 的官方网站。
<?php
Header("Location: http://www.php.net");
exit;
?>