Posted By

stuntsnippets on 07/28/10


Tagged

php gzip


Versions (?)

Gzip in PHP


 / Published in: PHP
 

URL: http://stuntsnippets.com/php-gzip/

  1. //put this on very top of you page
  2. if(extension_loaded('zlib')) { ob_start('ob_gzhandler'); $compressed = ''; }
  3. else { ob_start(); $compressed = ' not '; }
  4.  
  5. //replace next line with your code
  6. echo 'This content is ' . $compressed . 'compressed with PHP gzip.';
  7.  
  8. //put this in the end of your page

Report this snippet  

You need to login to post a comment.