Reading a compressed file : fgets « File Directory « PHP
- PHP
- File Directory
- fgets
Reading a compressed file
<?php
$fh = fopen('compress.zlib://lots-of-data.gz','r') or die("can't open: $php_errormsg");
while ($line = fgets($fh)) {
// $line is the next line of uncompressed data
}
fclose($fh) or die("can't close: $php_errormsg");
?>
Related examples in the same category