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

gztell

Description

The gztell of zlib for PHP tells the gz-file pointer to read/write a position.

Syntax

gztell(
    resource $stream
): int|false

Parameters

stream

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

Return

Returns the position of the file pointer or false if an error occurs.

Examples

1 · stream

<?

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

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

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

    $return = gztell($stream);

    echo $return;

gzclose($stream);

?>
0

2 · gzgetc

<?

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

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

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

    gzgetc($stream);

    $return = gztell($stream);

    echo $return;

gzclose($stream);

?>
1

3 · gzgets

<?

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

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

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

    gzgets($stream);

    $return = gztell($stream);

    echo $return;

gzclose($stream);

?>
4
HomeMenu