PHP Classes

File: v1/

Recommend this page to a friend!
  Classes of Thomas Björk   CSS parser   v1/   Download  
File: v1/
Role: Auxiliary data
Content type: text/markdown
Description: Moved the old cssparser to the folder v1 and created a folder v2 with a new CSSParser. The new version is not backwards compatible with the old version. But I've decided to release it in the same package as the old one since it is such an improvement over the old code which was based on code made for PHP4 in 2003.
Class: CSS parser
CSS parser class
Author: By
Last change: Update of v1/
Date: 5 days ago
Size: 1,126 bytes


Class file image Download


The cssparser is a small class that enables you to parse css information. The parsed css information can then be used in your application to fill your needs to use css information.


Clears the current content. If the html property of the class is set to true then the propertylist is filled with standard html information.


Set how to handle standard html information with clear. Set to true to include html properties and false to exclude it.

Add($key, $codestr);

Add a new propertystring to th list. The key represents under which tag/id/class/subclass to store the information. The codestr is a string of css properties. Each property should be separated by a ;. Values should be separated from the propertynames by a :.

Get($key, $property);

Retreive the value of a property.


Retreive all properties associated with the given key.


Parse a textstring that contains css information.


Parse a file that contains css information.


Returns a brute style css text compiled of the different properties.