functionob_gzip($content){if(!headers_sent()&&extension_loaded("zlib")&&strstr($_SERVER["HTTP_ACCEPT_ENCODING"],"gzip")){
$content = gzencode($content,9);
header("Content-Encoding: gzip");
header("Vary: Accept-Encoding");
header("Content-Length: ".strlen($content));
}
return$content;
}
ob_start('ob_gzip'); //函数名echo"这是测试字符串这是测试字符串这是测试字符串";
ob_end_flush();').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });
以上就介绍了PHP输出gzip压缩,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。











