![]() |
Just put following codes of your top of site. Better to put codes into header.php most top. |
<?php
function minify_output($buffer){ $search = array('/\>[^\S ]+/s','/[^\S ]+\</s','/(\s)+/s'); $replace = array('>','<','\\1'); if (preg_match("/\<html/i",$buffer) == 1 && preg_match("/\<\/html\>/i",$buffer) == 1) { $buffer = preg_replace($search, $replace, $buffer); $buffer = str_replace(array("\r", "\n"), '', $buffer); } return $buffer;
}
ob_start("minify_output");?>
php minify |
Type
: |
Develop |
Category
: |
Web Tutorial |
Sub Category
: |
PHP Function Tutorial |
Uploaded by
: |
Admin |