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

ob_gzhandler

Description

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

Syntax

ob_gzhandler(
    string $buffer,
    int $phase
): string|false

Parameters

buffer

Contents of the output buffer.

phase

Bitmask of PHP_OUTPUT_HANDLER_* constants.

ConstantValueDescription
PHP_OUTPUT_HANDLER_START1ouput buffer has started
PHP_OUTPUT_HANDLER_FLUSH4ouput buffer is being flushed
PHP_OUTPUT_HANDLER_FINAL8ouput 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