PHP解压函数gzdecode和gzinflate使用方法

原创
2016-06-23 13:37:48 2573浏览

PHP解压函数gzdecode和gzinflate使用方法技术

maybe yes 发表于2015-01-21 00:11

PHP 5.4 之后新增的 gzip 解压函数 gzdecode 使用方法,gzdecode ? Decodes a gzip compressed string,解压一个使用 gzip 压缩的字符串,这是官网手册上面写到的。

目前很多的空间服务商的 PHP 版本都没有达到 5.4 ,这也导致使用此函数之后发生函数未定义错误,该如何解决这个问题呢?PHP 官方网站用户提交的日志中有人给出了很好的解决方案,使用 gzinflate 函数代替,代码参考如下:

  

gzinflate 函数的功能大致和 gzdecode 相似,在返回值的注解中官方给出了一句提示“The function will return an error if the uncompressed data is more than 32768 times the length of the compressed input data or more than the optional parameter length. ”。

阅(84)评(0)查看评论


声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。