note 8750 added to gzcompress

From: Date: Tue, 26 Sep 2000 23:56:30 +0000
Subject: note 8750 added to gzcompress
Groups: php.notes 
Request: Send a blank email to php-notes+get-5456@lists.php.net to get a copy of this message
gzcompress DOES return gz compressed data. The only thing you still need is the GZ header before any gz compressed output (0x1F 0x8B 0x08 0x00 0x00 0x00 0x00 0x00 0x00). Here is a working example for buffered gz output: <?php Header("Content-Encoding: gzip"); echo "\x1f\x8b\x08\x00\x00\x00\x00\x00"; flush(); ob_start(); ob_implicit_flush(0); // output something, like include("/etc/rc.config"); // end of output $x = ob_get_contents(); ob_end_clean(); echo gzcompress($x,9); ?> http://www.php.net/manual/function.gzcompress.php

« previous php.notes (#5456) next »