Rate this script:  I Love it  /   I Hate it

Enabling Zip compression with PHP


Code


function compress_handler($in_output)
{
  return gzencode($in_output);
}
if (strpos($_SERVER['HTTP_ACCEPT_ENCODING'],'gzip') !== FALSE)
{
  ob_start('compress_handler');
  header('Content-Encoding: gzip');
}
else
{
  ob_start();
}
 

 

 
Enabling Zip compression with PHP scripts | Enabling Zip compression with PHP snippet | Enabling Zip compression with PHP example | Enabling Zip compression with PHP tutorial | Enabling Zip compression with PHP code