This function add a line to a .gz compressed file
<?php
function AppendLineGz($file,$string) {
if (file_exists($file)) {
$lines = gzfile($file);
$lines[count($lines)] = "$string\r\n";
$input=implode($lines);
} else {$input="$string\r\n";}
$gz = gzopen($file,'w9');
gzwrite($gz, $input);
gzclose($gz);
}
?>