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

ob_gzhandler

Description

The ob_gzhandler of zlib for PHP ob_start callback function to gzip output buffer.

Syntax

ob_gzhandler(
    string $data,
    int $flags
): string|false

Parameters

data

Contents of the output buffer.

flags

Bitmask of PHP_OUTPUT_HANDLER_* constants.

ValueConstantDescription
1PHP_OUTPUT_HANDLER_STARTouput buffer has started
4PHP_OUTPUT_HANDLER_FLUSHouput buffer is being flushed
8PHP_OUTPUT_HANDLER_FINALouput buffer will be ended

Return

Returns a string on success or false on failure.

Examples

1 · callback

<?

$callback = "ob_gzhandler";

ob_start($callback);

echo "output";

?>
output

2 · handler

<?

function myhandler($buffer, $phase)
{
    return ob_gzhandler($buffer, $phase);
}

$callback = "myhandler";

ob_start($callback);

echo "output";

?>
output
HomeMenu