GZGETS(3) 1 GZGETS(3)
gzgets - Get line from file pointer
SYNOPSIS
string gzgets (resource $zp, [int $length])
DESCRIPTION
Gets a (uncompressed) string of up to length - 1 bytes read from the given file pointer. Reading ends when length - 1 bytes have been
read, on a newline, or on EOF (whichever comes first).
PARAMETERS
o $zp
- The gz-file pointer. It must be valid, and must point to a file successfully opened by gzopen(3).
o $length
- The length of data to get.
RETURN VALUES
The uncompressed string, or FALSE on error.
EXAMPLES
Example #1
gzgets(3) example
<?php
$handle = gzopen('somefile.gz', 'r');
while (!gzeof($handle)) {
$buffer = gzgets($handle, 4096);
echo $buffer;
}
gzclose($handle);
?>
SEE ALSO
gzopen(3), gzgetc(3), gzwrite(3).
PHP Documentation Group GZGETS(3)