CSS-Parser
CSS-Parser copied to clipboard
A nice litte css parser written in php
CSS PARSER
General purpose CSS parser, work in progress. Parses CSS into an array and glues it back together.
USAGE
-
Include the library: include('parser.php');
-
Create a new parser object: $parser = new CssParser();
-
Load some css from a string... $parser->load_string('#foo { color:red; }'); ... from a file... $parser->load_file('style.css'); ... or from multiple files at once... $parser->load_file('reset.css;layout.css;skin.css');
-
$parser->parse();
-
Modify the array $parser->parsed and modify it as you like
-
use $parser->glue(); to turn the array back into css code