"找了很久都没有找到"——这不对吧?
手册中
header
送出 HTTP 协定的标头到浏览器语法: int header(string string);传回值: 整数函式种类: 网路系统
 
 
内容说明 
标头 (header) 是伺服器以 HTTP 协定传 HTML 资料到浏览器前所送出的字串,在标头与 HTML 文件之间尚需空一行分隔。有关 HTTP 的详细说明,可以参考坊间的相关书籍或更详细的 RFC 2068 官方文件(http://www.w3.org/Protocols/rfc2068/rfc2068)。在 PHP 中送回 HTML 资料前,需先传完所有的标头。 注意: 传统的标头一定包含下面三种标头之一,并只能出现一次。Content-Type: xxxx/yyyy
Location: xxxx:yyyy/zzzz
Status: nnn xxxxxx
在新的多型标头规格 (Multipart MIME) 方可以出现二次以上。
 
 
使用范例 
范例一: 本例用来重导使用者到 PHP 的官方网站。
<?php
Header("Location: http://www.php.net");  
exit;
?>范例二: 欲让使用者每次都能得到最新的资料,而不是 Proxy 或 cache 中的资料,可以使用下列的标头
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");范例三: 让使用者的浏览器出现找不到档案的讯息。
<?php
header("Status: 404 Not Found");
?>范例四: [email protected] (28-Apr-1999) 提供让使用者下载档案的范例。
header("Content-type: application/x-gzip");
header("Content-Disposition: attachment; filename=some-file.tar.gz");
header("Content-Description: PHP3 Generated Data");