CSS parser: CSS parser class

Recommend this page to a friend!
  Info   View files (15)   Download .zip   Reputation   Support forum (12)   Blog    
Ratings Unique User Downloads Download Rankings
64%Total: 9,069 This week: 2All time: 167 This week: 121
Version License PHP version Categories
cssparser 2.0.1GNU Lesser Genera...5HTML, Text processing, Parsers
Description Author

This class is able to parse CSS files making the properties available for examination and further processing.

Picture of Thomas Björk
  Performance   Level  
Name: Thomas Björk <contact>
Classes: 11 packages by
Country: Sweden Sweden
Age: 52
All time rank: 1631 in Sweden Sweden
Week rank: 135 3 in Sweden Sweden
Innovation award
Innovation award
Nominee: 3x

Details
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.

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

SetHTML($html);
===============
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.

GetSection($key);
=================
Retreive all properties associated with the given key.

ParseStr($str);
===============
Parse a textstring that contains css information.

Parse($filename);
=================
Parse a file that contains css information.

GetCSS();
=========
Returns a brute style css text compiled of the different properties.
  Files  
File Role Description
v1 (3 files)
v2 (1 file, 1 directory)
LICENSE Lic. License
README.md Doc. New readme file in markdown
readme.txt Doc. A simple documentation

  Files  /  v1  
File Role Description
   cssparser.php Class 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.
   example.php Example 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.
   README.md Data 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.

  Files  /  v2  
File Role Description
examples (8 files)
   cssparser.php Class 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.

  Files  /  v2  /  examples  
File Role Description
   css1.css Data Auxiliary data
   css2.css Data Auxiliary data
   css3.css Data Auxiliary data
   css4.css Data Auxiliary data
   example1.php Example Example script
   example2.php Example Example script
   example3.php Example Example script
   example4.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 93%
Total:9,069
This week:2
All time:167
This week:121
User Ratings User Comments (6)
 All time
Utility:83%
Consistency:82%
Documentation:70%
Examples:72%
Tests:-
Videos:-
Overall:64%
Rank:915
 
can you please provide little more documentation on how to re...
2 years ago (sachin mohite)
75%
Works! And easy enough to figure out without dox.
5 years ago (F Philip DeGeorge)
67%
Very helpful, thank you.
7 years ago (php max)
80%
lower case for all elements is wrong, as there may be url() w...
8 years ago (Headroom)
72%
Very useful class.
9 years ago (Eric Guerin)
62%
PHP Version 5.
11 years ago (Shawn Coppock)
15%
 

For more information send a message to info at phpclasses dot org.