header(string,replace,http_response_code)
string 必需,規定要發送的報頭字符串.
replace 可選,指示該報頭是否替換之前的報頭,或添加第二個報頭.
默認是 true(替換),false(允許相同類型的多個報頭).
http_response_code 可選,把 http 響應代碼強制為指定的值,(php 4 以及更高版本可用)
跳轉:
header('location: http://www.phpfensi.com/');發送http狀態
header("status: 404 not found");
設置緩存:
header("cache-control: no-cache, must-revalidate"); // http/1.1
header("expires:sat,26 jul 1997 05:00:00 gmt");
利用header做文件下載功能: