Situation
I'm struggling trying to minify my index.php file
I've tried
Here is what's in my : index.php
<?php include 'master.php'; ?>
<?php
function htmlmin($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);
}
return $buffer;
}
ob_start("htmlmin");
?>
When I do view page source
, I still see my html output is not minify.
I know that I did something wrong, but I'm not sure what it is.
Did I forget to do something ? Am I on the right track ? Can someone please give me hint ?