Monday, May 25, 2009

Compressing Zip file in PHP


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();
}

?>

No comments: