HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

gzrewind

Description

The gzrewind of zlib for PHP rewinds the position of a gz-file pointer.

Syntax

gzrewind(
    resource $stream
): bool

Parameters

stream

The gz-file pointer. It must be valid, and must point to a file successfully opened by gzopen().

Return

Returns true on success or false on failure.

Examples

1 · stream

<?

$filename = $_SERVER["DOCUMENT_ROOT"] . "/assets/gz/1.gz";
$mode = "r";

$stream = gzopen($filename, $mode);

    if($stream === false)
    {
        die("gzopen");
    }

    while(!gzeof($stream))
    {
        gzgetc($stream);
    }

    $return = gzrewind($stream);

    var_export($return);

gzclose($stream);
true