Re: PHP 4.0 Bug #7033 Updated: gzcompress does not work as expected

From: Date: Tue, 17 Oct 2000 16:32:47 +0000
Subject: Re: PHP 4.0 Bug #7033 Updated: gzcompress does not work as expected
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-35278@lists.php.net to get a copy of this message
Try this snippet: $content = "Some test string."; $gzheader=chr(0x1F).chr(0x8B).chr(0x08).chr(0x00).chr(0x00).chr(0x00).chr(0x 00).chr(0x00).chr(0x00).chr(0x03); $crc=putLong(crc32($content)); $len=putLong(strlen($content)); header("Content-Encoding: gzip"); echo $gzheader.substr(substr($content, 0, strlen($content)-4).$crc.$len, 2); function putLong ($long){ for ($n = 0; $n < 4; $n++) { $ret.=chr((integer)($long & 0xff)); $long = $long >> 8; } return $ret; } With best wishes, Denis, webmaster@atlant.ru

« previous php.dev (#35278) next »