if(ob_get_level() > 0){ //there are some buffers active. } $ php -d output_buffering=1 -r'var_dump(ob_get_level());' int(1) $ php -d output_buffering=0 -r'var_dump(ob_get_level());' int(0)
However, it checks to see if there is an active output buffer, not the actual configuration of PHP itself. The ob_start() manual (or more than one) will also increase the level. This is usually more interesting than the actual output_buffering . If you really need it, fo with the answer ini_get .
Wrikken
source share