php header()
header() 函数向客户端发送原始的 HTTP 报头。
例:
<?php
header('Location: http://www.baidu.com/');
?>
访问即可跳转到baidu。
header(string,replace,http_response_code)string 必需--发送的表头字符串
replace 可选--替换的报头
http_response_code 可选--HTTP 响应代码强制为指定的值
<?php
// Date in the past
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Cache-Control: no-cache");
header("Pragma: no-cache");
?>
强制浏览器不进行缓存