I use output buffering for gzip compression and access to what was put out before in a PHP script:
if(!ob_start(\"ob_gzhandler\")) ob_start();
General:
if (ob_get_status()) { // ob started }
More specific
$status = ob_get_status(); if ($status['name']=='ob_gzhandler') { // ob named ob_gzhandler started }