2014年12月23日 星期二

PHP echo json_encode error

Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at )


origin :
...
echo json_encode($myarray);

fix :
...
header("Content-type: application/json; charset=utf-8");
echo json_encode($myarray);
die;









References :
Output.php with compress_output = true, always calls ob_start(‘ob_gzhandler’) causing warning with ajax / Forums / Community / EllisLab

沒有留言:

張貼留言