Heim >Backend-Entwicklung >PHP-Tutorial >开启OB缓存无效?求解。该如何处理
开启OB缓存无效???求解。
是这样的,php.ini的ob是关闭的,我直接运行下面的代码提示错误:
<?php<br />echo "ok";<br />header("content-type:text/html;charset=utf-8");<br />echo "ook";<br />?>
ok<br />Warning: <br />Cannot modify header information - headers already sent by (output started at C:\php\apache\htdocs\static\test.php:1) in C:\php\apache\htdocs\static\test.php on line 4<br />ook
<?php<br />ob_start(); <br />echo "ok";<br />header("content-type:text/html;charset=utf-8");<br />echo "ook";<br />?>
ok<br />Warning: Cannot modify header information - headers already sent by (output started at C:\php\apache\htdocs\static\test.php:1) in C:\php\apache\htdocs\static\test.php on line 4<br />ook