PHP Classes

File: application/hooks/compress.php

Recommend this page to a friend!
  Classes of Abed Nego Ragil Putra   PHP Attendance Management System using Fingerprint   application/hooks/compress.php   Download  
File: application/hooks/compress.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Attendance Management System using Fingerprint
Keep track of employee attendance with fingerprint
Author: By
Last change: improve feature, now with datables, fix some bugs

improve feature, now with datables, fix some bugs
Date: 10 months ago
Size: 885 bytes
 

Contents

Class file image Download
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

/*
| -------------------------------------------------------------------------
| Compress HTML display
| -------------------------------------------------------------------------
|
*/
function compress()
{
   
$CI =& get_instance();
   
$buffer = $CI->output->get_output();

   
$search = array(
       
'/\>[^\S ]+/s',
       
'/[^\S ]+\</s',
       
'/(\s)+/s', // shorten multiple whitespace sequences
       
'#(?://)?<!\[CDATA\[(.*?)(?://)?\]\]>#s' //leave CDATA alone
   
);
   
$replace = array(
       
'>',
       
'<',
       
'\\1',
       
"//&lt;![CDATA[\n" . '\1' . "\n//]]>"
   
);

   
$buffer = preg_replace($search, $replace, $buffer);

   
$CI->output->set_output($buffer);
   
$CI->output->_display();
}

/* End of file compress.php */
/* Location: ./system/application/hools/compress.php */