dougu1985 2014-10-30 10:50
浏览 20

php中的Memcache和Setcookie - 无法修改标题

I saw something strange in php version 5.5:

This code:

1   $memcache = new Memcache();
n   ...
100 $something = $memcache -> get("something");
101 setcookie("myCookie","om-nom-nom-nom",0,0);

will return:

Cannot modify header information - headers already sent by
(output started at troll.php:100) in troll.php on line 101

It seems that memcache::get() is changing header. Wtf? Is this an error or maybe I made something wrong?

  • 写回答

0条回答 默认 最新

    报告相同问题?