Current Location: Home> Function Categories> ob_gzhandler

ob_gzhandler

Ob_start callback function for gzip output buffer
Name:ob_gzhandler
Category:Output buffer control
Programming Language:php
One-line Description:Used as a callback function for ob_start() to compress the buffer content when it is sent to the browser.

Definition and usage

ob_gzhandler() function is intended to be passed as a callback function for ob_start() . It uses the compression algorithm supported by the browser to compress the contents of the output buffer and returns the compressed contents. It also sends an HTTP header indicating which compression algorithm is used.

Example

Add gzip compression to the page:

 <?php
ob_start ( "ob_gzhandler" ) ;
echo "Hello World!" ;
?>

Try it yourself

Similar Functions
Popular Articles