PHP 输出缓冲检查?
可能的重复:
PHP - 如何检测输出缓冲是否打开
如果output_buffering设置为On,我如何在PHP中检查?我必须对网站进行故障排除,但无法访问托管面板。
比如:
if(output_buffering == 'On')
{
echo 'It is On';
}
else
{
echo 'It is NOT On';
}
谢谢!
Possible Duplicate:
PHP - How Detect if Output Buffering is Turned On
How can I check in PHP if output_buffering is set to On? I have to troubleshoot a site and I have no access to the hosting panel.
Something like:
if(output_buffering == 'On')
{
echo 'It is On';
}
else
{
echo 'It is NOT On';
}
Thank you!
然而,它确实检查是否有活动的输出缓冲区,而不是 PHP 本身的实际设置。手动
ob_start()
(或多个)也会提高级别。通常这比实际的output_buffering
设置更有趣。如果您确实需要那个,请使用ini_get
答案。It does however check whether there is an output buffer active, not what the actual setting of PHP itself is. A manual
ob_start()
(or more then one) will also increase the level. Usually this is more interesting then the actualoutput_buffering
setting. If you actually need that, fo with theini_get
answer.