原文链接:PHP Header用于页面跳转要注意的几个问题总结php技巧脚本之家
搜到了这篇文章,开头就说了三个关于PHP header()的注意事项,
第3点测试结果无误。
第1点,测试大概是指的 header('Location: http://segmentfault.com/'); 中 Location 和 : 不能有空格吧,但其实是可以有的。
主要是第2点,header前不能有任何的输出有疑问,我测试了下面的代码,能成功跳转啊:
asdf
到底要怎样测试才能报错呢?php手册上的“Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP”到底是啥意思?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
欢迎选择我的课程,让我们一起见证您的进步~~