header()

2018-01-03  本文已影响0人  panw3i
<html>
<?php
/* This will give an error. Note the output
 * above, which is before the header() call */
header('Location: http://www.example.com/');
exit;
?>
image.png
<?php
// 返回当前状态码,并设置新的状态码
var_dump(http_response_code(404));

//获取新的状态码
var_dump(http_response_code());
?>

<?php
header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past  过期时间
?>
上一篇 下一篇

猜你喜欢

热点阅读