PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

gzopen> <gzgetss
Last updated: Fri, 26 Sep 2008

view this page in

gzinflate

(PHP 4 >= 4.0.4, PHP 5)

gzinflateРаспаковывает строку

Описание

string gzinflate ( string $data [, int $length ] )

Распаковывает сжатую строку.

Список параметров

data

Данные, сжатые функцией gzdeflate().

length

Максимальная длина данных для распаковки.

Возвращаемые значения

Распакованные данные или FALSE в случае ошибки.

Функция сообщит об ошибке также в случае, когда распакованные данные длиннее в более, чем 32768 или length раз, сжатых.

Смотрите также



gzopen> <gzgetss
Last updated: Fri, 26 Sep 2008
 
add a note add a note User Contributed Notes
gzinflate
John
13-Jun-2008 07:22
And when retrieving mod_deflate gzip'ed content and using gzinflate() to decode the data, be sure to strip the first 11 chars from the retrieved content.

$dec = gzinflate(substr($enc,11));
patatraboum at free dot fr
24-Aug-2007 07:57
Some gz string strip header and return inflated
It actualy processes some first member of the gz
See rfc1952 at http://www.faqs.org/rfcs/rfc1952.html for more details and improvment as gzdecode

<?
function gzBody($gzData){
    if(
substr($gzData,0,3)=="\x1f\x8b\x08"){
       
$i=10;
       
$flg=ord(substr($gzData,3,1));
        if(
$flg>0){
            if(
$flg&4){
                list(
$xlen)=unpack('v',substr($gzData,$i,2));
               
$i=$i+2+$xlen;
            }
            if(
$flg&8) $i=strpos($gzData,"\0",$i)+1;
            if(
$flg&16) $i=strpos($gzData,"\0",$i)+1;
            if(
$flg&2) $i=$i+2;
        }
        return
gzinflate(substr($gzData,$i,-8));
    }
    else return
false;
}
?>
spikeles_ at hotmail dot com
02-Nov-2006 05:12
This can be used to inflate streams compressed by the Java class java.util.zip.Deflater but you must strip the first 2 bytes off it. ( much like the above comment )

$result = gzinflate(substr($compressedData, 2))
boris at gamate dot com
08-Jul-2003 02:49
When retrieving mod_gzip'ed content and using gzinflate() to decode the data, be sure to strip the first 10 chars from the retrieved content.

$dec = gzinflate(substr($enc,10));

gzopen> <gzgetss
Last updated: Fri, 26 Sep 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites