PHP Function Gzinflate
Article about php function gzinflate
A comprehensive set of real world PHP examples of the zlib library function gzinflate(). If you use the mod_deflate gzip compression module with PHP, you will probably want to take advantage of this useful utility. This code shows how to retrieve gzip'ed data from the mod_deflate cache, decode it with gzinflate() and print out the result. This code works by default with zlib streams, which include a 2 byte header and a 4 byte trailer. If you are using a more recent version of zlib, you may need to switch to the gzcompress and gzuncompress functions, which produce ZLIB format or (if your version of zlib supports it) specify a negative value for windowBits, which requests raw DEFLATE format.
This code is written and tested with PHP 5.3 on 32bit Linux.