php - 说好的header()前面不能有输出的呢?
阿神
阿神 2017-04-10 14:42:59
0
2
317

看手册上说header()调用之前,前面不能有任何输出,但是我测试发现,完全可以有呀?我空了,还多,还是可以执行。那为什么最新版的手册一直都还没更新呢?http://www.php.net/manual/en/function.header.php
我是这样写的

<html>

111
<?php
/* This will give an error. Note the output
 * above, which is before the header() call */
header('Location: http://www.example.com/');
exit;
?>
阿神
阿神

闭关修行中......

Antworte allen(2)
刘奇

你没碰上并不一定就是不存在,眼见不一定为实。

http://segmentfault.com/q/1010000000377390

伊谢尔伦

赞楼上的,是因为缓冲区在脚本执行完才输出,此时你立刻刷新,必须出错。

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage