我写了个压缩的程序,zlib扩展和ob_gzhandler都支持,但是firefox中会提示“无法显示您尝试查看的页面,因为它使用了无效或者不支持的压缩格式。”,请问是什么原因呢?还有就是怎样检查是否真正的压缩了网页呢?<?php
if(!extension_loaded('zlib')){
die("找到问题了!");
}
if (function_exists('ob_gzhandler')) {
ob_start('ob_gzhandler');
} else {
ob_start();
}
?>
//以下是HTML代码,没有全写出
<!DOCTYPE html><html><head><title>haha</title></head>
<body>hello哈哈哈</body></html>
<?php 
$content = ob_get_contents();
ob_end_clean();
echo $content;
?>