note 106397 added to function.gzdecode
| From: | tomas at slax dot org | Date: | Sat, 05 Nov 2011 12:25:52 +0000 |
| Subject: | note 106397 added to function.gzdecode | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184308@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:
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.
----
Server IP: 69.147.83.197
Probable Submitter: 88.102.100.37
----
Manual Page -- http://www.php.net/manual/en/function.gzdecode.php
Edit -- https://master.php.net/note/edit/106397
Del: integrated -- https://master.php.net/note/delete/106397/integrated
Del: useless -- https://master.php.net/note/delete/106397/useless
Del: bad code -- https://master.php.net/note/delete/106397/bad+code
Del: spam -- https://master.php.net/note/delete/106397/spam
Del: non-english -- https://master.php.net/note/delete/106397/non-english
Del: in docs -- https://master.php.net/note/delete/106397/in+docs
Del: other reasons-- https://master.php.net/note/delete/106397
Reject -- https://master.php.net/note/reject/106397
Search -- https://master.php.net/manage/user-notes.php