joris

Hook

Jun 16th, 2012
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.52 KB | None | 0 0
  1. class KompresHalaman {
  2.     function compress(){
  3.          $CI =& get_instance();
  4.          $buffer = $CI->output->get_output();
  5.          
  6.          $search = array(
  7.             '/\>[^\S ]+/s',
  8.             '/[^\S ]+\#s');
  9.              
  10.          $replace = array(
  11.             '>',
  12.             '<',
  13.             '\\1',
  14.             "//<![CDATA[\n".'\1'."\n//]]>");
  15.              
  16.          $buffer = preg_replace($search, $replace, $buffer);
  17.          $CI->output->set_output($buffer);
  18.          $CI->output->_display();
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment