note 88682 modified in function.gzwrite by danbrown

From: Date: Tue, 03 Feb 2009 18:45:57 +0000
Subject: note 88682 modified in function.gzwrite by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-150155@lists.php.net to get a copy of this message
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); } ?> --was-- This function add a line to a .gz compressed file 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); } http://php.net/manual/en/function.gzwrite.php

« previous php.notes (#150155) next »