1$css = '';
2$root = $_SERVER['DOCUMENT_ROOT'].'/css/'; //directory where the css lives
3$files = explode(',',$_SERVER['QUERY_STRING']);
4if(sizeof($files))
5{
6 foreach($files as $file)
7 {
8 $css.= (is_file($root.$file.'.css') ? file_get_contents($root.$file.'.css') : '');
9 }
10}
11return str_replace('; ',';',str_replace(' }','}',str_replace('{ ','{',str_replace(array("\r\n","\r","\n","\t",' ',' ',' '),"",preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!','',$css)))));