Return to Snippet

Revision: 28066
at June 30, 2010 06:55 by yves


Initial Code
<?php
    ob_start ("ob_gzhandler");
    header("Content-type: text/css; charset: UTF-8");
    header("Cache-Control: must-revalidate");
    $offset = 60 * 60 ;
    $ExpStr = "Expires: " .
    gmdate("D, d M Y H:i:s",
    time() + $offset) . " GMT";
    header($ExpStr);
?>

body { color: red; }

Initial URL
http://css-tricks.com/snippets/css/compress-css-with-php/

Initial Description
Start your CSS files with the following PHP (and name it style.php)

include it with: <link>

Initial Title
Compress CSS with PHP

Initial Tags
css, php

Initial Language
PHP