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|falseParameters
buffer
Contents of the output buffer.
phase
Bitmask of PHP_OUTPUT_HANDLER_* constants.
| Constant | Value | Description |
|---|---|---|
| PHP_OUTPUT_HANDLER_START | 1 | ouput buffer has started |
| PHP_OUTPUT_HANDLER_FLUSH | 4 | ouput buffer is being flushed |
| PHP_OUTPUT_HANDLER_FINAL | 8 | ouput 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