All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
HTML语言剖析(八)表单标记_[Html教程]
XSL教程:了解XSL的选择模式_[XML教程]
以图换字的几个方法及思路_[Html教程]
动态网页制作PHP入门:PHP是什么?_php资料_编程技术
SQL,Server中的CTE_mssql学习_编程技术
SQL,Server,2008在商务智能上的三个优化_mssql学习_编程技术
AJAX实例:Ajax实现静态页面分页_[AJAX教程]
delphi获取Windows目录
Ajax 中的高级请求和响应_[AJAX教程]
Php高手带路--问题汇总解答_[PHP教程]
Reading number is top 10 pictures
LiXiang early youth photo
人物写真-谢楠
西游日记1
宝贝系列
乳娘帕梅拉安德森3
Hunan province aizhai super-large suspension bridge open to traffic and 4 world first1
西方气质的东方美女2
NeedWallpaper4
中国女孩大胆自拍,显露完美身材4
西班牙山村小景2
Download software ranking
Boxer vs Yellow1
Boxer's Top ten classic battle8
Desire a peach blossom
Boxer Classic video3
Unix video tutorial4
Unix video tutorial17
好色的外科大夫
Sora aoi, the maid, students' uniforms
Tram sex maniac 2 (H) rar bag5
Boxer's Top ten classic battle10
归海一刀 published in(发表于) 2014/2/17 7:33:48 Edit(编辑)
PHP实现gzip页面压缩方法_[PHP教程]

PHP实现gzip页面压缩方法_[PHP教程]

PHP实现gzip页面压缩方法_[PHP教程]
示例一(用php的内置压缩函数):

if(Extension_Loaded(’zlib’)) Ob_Start(’ob_gzhandler’);
Header("Content-type: text/html");
?>




无标题文档


for($i=0;$i<10000;$i++){
echo ’Hello World!’;
}
?>


if(Extension_Loaded(’zlib’)) Ob_End_Flush();
?>


示例二(自写函数):







无标题文档






ob_end_flush();
//压缩函数
function ob_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;
}
?>



添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.