Advertisement
joris

kompres

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