标签:
<?php
echo "原来比率<br />";
$str = ‘{.....}‘;
echo strlen($str).‘<br />‘;
//压缩率居中
$compressed = gzcompress($str, 9);
echo ‘gzcompress:‘.strlen($compressed).‘,‘."<br />"; //gzuncompress($compressed)
//压缩率并列最高
$compressed = gzdeflate($str, 9);
echo ‘gzdeflate:‘.strlen($compressed).‘,‘."<br />"; //gzinflate($compressed)
$bzstr = bzcompress($str, 9);
echo ‘bzcompress:‘.strlen($bzstr).‘,‘."<br />"; //bzdecompress($bzstr)
如何进行PHP压缩(一点经验分享)
标签:
原文地址:http://www.cnblogs.com/phplover2014/p/4189024.html