gzfile
(PHP 4, PHP 5, PHP 7, PHP 8)
gzfile — Read entire gz-file into an array
Description
This function is identical to readgzfile(), except that it returns the file in an array.
Parameters
filenameThe file name.
use_include_path- If set to
true, files in the include_path are searched for too.
Return Values
An array containing the file, one line per cell, empty lines included, and with newlines still attached, or false on failure.
Changelog
| Version | Description |
|---|---|
| 8.5.0 | use_include_path is now of type bool. Previously, it was of type int. |
Examples
Example #1 gzfile() example
<?php
$lines = gzfile('somefile.gz');
foreach ($lines as $line) {
echo $line;
}
?>See Also
- readgzfile() - Output a gz-file
- gzopen() - Open gz-file
↑ and ↓ to navigate • Enter to select • Esc to close • / to open