zlib extension
The zlib extension provides functions to handle the zlib compression format: read, write and access arbitrary part of files. It also provide a compression format for the output of PHP.
There is also a PHP wrapper for zlib, when the zlib extension is compiled: zlib://.
<?php
$lines = gzfile('somefile.gz');
foreach ($lines as $line) {
echo $line . PHP_EOL;
}
?>
See Also
- Using zlib for Page Compression
- Introducing streaming zlib compression and decompression with ReactPHP