gzpassthru
Description
The gzpassthru of zlib for PHP outputs all the remaining data on a gz-file pointer.
Syntax
gzpassthru( resource $stream ): int
Parameters
stream
The gz-file pointer. It must be valid, and must point to a file successfully opened by gzopen().
Return
Returns the number of uncompressed characters read from gz and passed through to the input.
Examples
1 · stream
<? $filename = $_SERVER["DOCUMENT_ROOT"] . "/assets/gz/1.gz"; $mode = "r"; $stream = gzopen($filename, $mode); if($stream === false) { die("gzopen"); } gzgetc($stream); gzpassthru($stream); gzclose($stream);
ata
2 · return
<? $filename = $_SERVER["DOCUMENT_ROOT"] . "/assets/gz/1.gz"; $mode = "r"; $stream = gzopen($filename, $mode); if($stream === false) { die("gzopen"); } gzgetc($stream); $return = gzpassthru($stream); echo PHP_EOL . $return; gzclose($stream);
ata 3