ob_gzhandler
Ob_start callback function for gzip output buffer
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.
Add gzip compression to the page:
<?php ob_start ( "ob_gzhandler" ) ; echo "Hello World!" ; ?>
Try it yourself