note 106397 modified in function.gzdecode by danbrown

From: Date: Tue, 15 Nov 2011 16:53:26 +0000
Subject: note 106397 modified in function.gzdecode by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-184513@lists.php.net to get a copy of this message
I don't have any deep knowledge in compression algorithms and formats, so I have no idea if this works the same on all platforms. But by several experiments on my Linux box I found how to get gzdecoded data without temporary files. Here it is: <?php function gzdecode($data) { return gzinflate(substr($data,10,-8)); } ?> That's it. Simply strip header and footer bytes and you get raw deflated data for inflation. --was-- I don't have any deep knowledge in compression algorithms and formats, so I have no idea if this works the same on all platforms. But by several experiments on my Linux box I found how to get gzdecoded data without temporary files. Here it is: function gzdecode($data) { return gzinflate(substr($data,10,-8)); } That's it. Simply strip header and footer bytes and you get raw deflated data for inflation. http://php.net/manual/en/function.gzdecode.php

« previous php.notes (#184513) next »