Create a style.php with the following content:
<?php
header('Content-type: text/css');
ob_start("compress");
function compress($buffer) {
/* remove comments */
$buffer = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $buffer);
/* remove tabs, spaces, newlines, etc. */
$buffer = str_replace(array("\r", "\n", "\t"), '', $buffer);
return $buffer;
}
/* your CSS files, can be several */
include('main.css');
include('main2.css');
ob_end_flush();
?>
Then, wherever your HTML needs the CSS, reference it like this:
<link rel="stylesheet" type="text/css" media="screen" href="style.php"/>
Quantum Responses (0)