无法修改标头信息 - 已经发送的标头(已附加代码)

时间:2017-08-16 20:30:15

标签: php phpmailer

为什么会出现这种错误?代码如下:

<?php
header('Cache-Control:no-cache,must-revalidate,max-age=0');     
?>

1 个答案:

答案 0 :(得分:0)

您可以尝试以下操作:

<?php

header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
?>

请注意,使用的确切标头取决于您的需求(如果您需要支持HTTP 1.0和/或HTTP 1.1)

相关问题