Monday, August 8, 2011

Enable GZIP in PHP Application

Already i shown how to enable GZIP in YII Framework application, To enable GZIP in general PHP Application include the below code at the top of the document you want to gzip:

if( isset( $_SERVER['HTTP_ACCEPT_ENCODING'] ) && substr_count( $_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip' ) )
 ob_start( 'ob_gzhandler' );

1 comment:

Jackie Co Kad said...

I have read your blog its very attractive and impressive. I like it your blog.

PHP 7 Training in chennai | PHP 7 Training Course

PHP 7 Training in chennai | Online PHP 7 Course