HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
PHP Output Control Functions : Add gzip compression to a page
This function is intended to be passed as a callback to ob_start()
. It compresses the
contents of the output buffer using a compression algorithm that is supported by the
browser and returns the compressed content. It also sends an HTTP header indicating
which compression algorithm was used.
When used as a callback for ob_start()
:
When used on its own:
Parameter | Description |
---|---|
buffer | The contents of the output buffer |
phase | A bitmask which may have any number of the following flags: PHP_OUTPUT_HANDLER_START - If the output buffer was just created PHP_OUTPUT_HANDLER_FLUSH - If the output buffer is currently being flushed PHP_OUTPUT_HANDLER_FINAL - If the output buffer will be deleted right after this operation |
Return Value: | Returns a string containing the compressed contents |
---|---|
PHP Version: | 4.0.4+ |
❮ PHP Output Control Functions