I’m sending content to the browser via gzip if they support it (for css/js), currently I just use :
stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== False
However, if there was some output before then (ie. php error/warning), this breaks the gzip output and the browser (firefox at least) says the site is using an unsupported form of compression (because of the the prior output).
So, is there a way to detect if output was sent? or is there a better way to do it?
You can use
headers_sent()i believe.