/*
USING THIS FILE
1. Add the CSS files you want included to the $file array. */
$file[] = 'reset.css';
$file[] = 'typography.css';
$file[] = 'design.css';
/*
2. Save this file.
3. Point your HTML files to this script, eg.
<link rel="stylesheet" href="/this-file.php" />
4. Save the HTML file and refresh browser.
*/
header('Content-type: text/css; Charset=utf-8');
function minifyCSS($f)
{
return preg_replace(array('/\/\*[\s\S]*?\*\//','/\s*([;:{},>+])\s*/',
'/;}/','/\r?\n/'),array('','\1','}',''),file_get_contents($f));
}
foreach ($file as $name)
{
if (file_exists($name))
{
echo minifyCSS($name);
}
}