<?php /** * header(): */ //重新导向一个URL,自动跳转到一个想要的页面 header('Location:date.php'); header('Location:http://www.baidu.com'); //在执行header()函数时必须注意,之前不能有任何浏览器输出.如下的写法会有错误。除非启用了缓冲区 //启用缓冲区,只需要php代码的第一行写上ob_start(),即可解决此问题。 echo 'baidu.com'; header('Location:http://www.baidu.com'); //字符编码 //需要注意文件编码与页面编码一致 header('Content-Type:text/html;charser=gbk'); //设置页面编码 echo '嘿嘿,我是中文件'; ?> |
|