PHP decompression function Gzdecode and gzinflate use method Technology
Maybe yes posted on 2015-01-21 00:11
Original link: http://blog.lmlphp.com/archives/65 from: lmlphp backyard
PHP 5.4 After the new gzip decompression function Gzdecode usage, gzdecode-decodes a gzip compressed string, unzip a string using gzip compression, which is written on the official website manual.
The current PHP version of a lot of space service providers have not reached 5.4, which also caused the function after using this function undefined error, how to solve the problem? PHP official web site users submitted a log in a good solution, using the Gzinflate function instead, the code reference is as follows:
<?phpif (!function_exists (' Gzdecode ')) {function Gzdecode ($data) {return gzinflate (substr ($data, 10,-8));}}
The functions of the Gzinflate function are roughly similar to those of Gzdecode, and in the comments of the return value, the official gives a hint "the function would return an error if the uncompressed data are more than 3 2768 times the length of the compressed input data or more than the optional parameter length. ”。
Read (84) reviews (0) View comments
PHP decompression function Gzdecode and gzinflate use method