PHP Gz Compress

Gz Compress

<?
$filename = 'zlibtest.gz';
$s = "Only a test, test, test, test, test, test, test, test!";

$zp = gzopen($filename, "wb9");
gzwrite($zp, $s);
gzclose($zp);
$zp = gzopen($filename, "r");
print gzread($zp, 3);
gzpassthru($zp);
if (readgzfile($filename) != strlen($s)) { echo "Error with zlib functions!"; }
?>