note 20411 added to function.gzencode

From: Date: Wed, 03 Apr 2002 07:53:28 +0000
Subject: note 20411 added to function.gzencode
Groups: php.notes 
Request: Send a blank email to php-notes+get-28528@lists.php.net to get a copy of this message
The 10 byte string in gzencode is the standard gzip header. The first two bytes (1f 8b) define the return as a gzip file, the third byte (08) means that the body is compressed using the "deflate" algorithm. The rest is padding (00)'s. Technically, I believe one should check if the third byte is hex 08 and if so strip off the first ten bytes and last four bytes and run inflate on it. The last four bytes are file size and checksum bits. In practice, you can get away with just stripping the first 10 bytes and running inflate on it. Hope this helps, terry -- http://www.php.net/manual/en/function.gzencode.php http://master.php.net/manage/user-notes.php?action=edit+20411 http://master.php.net/manage/user-notes.php?action=delete+20411 http://master.php.net/manage/user-notes.php?action=reject+20411

« previous php.notes (#28528) next »