5ubliminal@twitter

gzdecode Function in PHP | Expand GZip Files : 5ubliminal's TellinYa

<a href="http://www.tellinya.com/art2/83/">gzdecode Function in PHP | Expand GZip Files : 5ubliminal's TellinYa</a>
5ubliminal's YAMS
The PHP gzdecode function

<?
//--------------------------------------------------------------------------------------------------
if (!function_exists('gzdecode')) {
    function 
gzdecode ($data) {
        
$flags ord(substr($data31));
        
$headerlen 10;
        
$extralen 0;
        
$filenamelen 0;
        if (
$flags 4) {
            
$extralen unpack('v' ,substr($data102));
            
$extralen $extralen[1];
            
$headerlen += $extralen;
        }
        if (
$flags 8// Filename
            
$headerlen strpos($datachr(0), $headerlen) + 1;
        if (
$flags 16// Comment
            
$headerlen strpos($datachr(0), $headerlen) + 1;
        if (
$flags 2// CRC at end of file
            
$headerlen += 2;
        
$unpacked gzinflate(substr($data$headerlen));
        if (
$unpacked === FALSE)
              
$unpacked $data;
        return 
$unpacked;
     }
}
//--------------------------------------------------------------------------------------------------
?>

PS: What else is there to say?

13 Comments Posted By Readers :

Add your comment
#1 Blaise from Netherlands
Posted on Tuesday, 04 September, 2007
Thank you! Works like a charm.
#2 karru from Germany
Posted on Friday, 07 September, 2007
Thanks! :)
#3 apc from Netherlands
Posted on Thursday, 27 September, 2007
great, after hours of search, try and error, i found your function. works like a charm!
#4 Steve from European Union
Posted on Tuesday, 12 February, 2008
Fantastic. Thank you, saved my life. :-)
#5 Mike P. Mikhailv from Russian Federation
Posted on Sunday, 24 February, 2008
You are the best ! A lot of thanks for you !
#6 5ubliminal web
Posted on Sunday, 24 February, 2008
You're welcome! In the next week I'll have an updated version.
Check around.
#7 Aamer from Germany
Posted on Tuesday, 26 February, 2008
i had problem with gzdecode, then i found this site, it really works.
best thanks
#8 nb from Ukraine
Posted on Monday, 03 March, 2008
Great thanks to you!
#9 Lou from Russian Federation
Posted on Monday, 10 March, 2008
Thanks!!!
#10 robbie from Russian Federation
Posted on Friday, 28 March, 2008
thanks a lot man!
#11 Rob C from United States web
Posted on Saturday, 29 March, 2008
Thanks!
#12 dominic from Germany
Posted on Tuesday, 24 June, 2008
thanks so much!
#13 RazP from New Zealand web
Posted on Tuesday, 02 September, 2008
Cheers mate
Post Feedback 
Name *
Mail *
URL
« Anti-Spam
» URL will only go live after a review. Comments are moderated. «
5ubliminal's TellinYa.com SEM & SEO Blog © 2007 - All rights reserved unless mentioned otherwise .
Rendered On : [Tuesday, 06 January, 2009 - 00:04:12 GMT]   No Ajax / Flash Used Here
" gzdecode Function in PHP | Expand GZip Files : 5ubliminal's TellinYa "
Close
Tellinya.com is relocating to blog.5ubliminal.com