PHP Classes
elePHPant
Icontem

CSS parser: CSS parser class

Recommend this page to a friend!
  Info   View files View files (15)   DownloadInstall with Composer Download .zip   Reputation   Support forum (11)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2014-08-08 (2 years ago) RSS 2.0 feedStarStarStarStar 62%Total: 8,826 This week: 2All time: 170 This week: 402Down
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.

  Performance   Level  
Name: Thomas Björk <contact>
Classes: 11 packages by
Country: Sweden Sweden
Age: 49
All time rank: 1651 in Sweden Sweden
Week rank: 351 Down2 in Sweden Sweden Down
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 folder image Files  
File Role Description
Files folder imagev1 (3 files)
Files folder imagev2 (1 file, 1 directory)
Accessible without login Plain text file LICENSE Lic. License
Accessible without login Plain text file README.md Doc. New readme file in markdown
Accessible without login Plain text file readme.txt Doc. A simple documentation

  Files folder image Files  /  v1  
File Role Description
  Plain text file 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.
  Accessible without login Plain text file 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.
  Accessible without login Plain text file 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 folder image Files  /  v2  
File Role Description
Files folder imageexamples (8 files)
  Plain text file 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 folder image Files  /  v2  /  examples  
File Role Description
  Accessible without login Plain text file css1.css Data Auxiliary data
  Accessible without login Plain text file css2.css Data Auxiliary data
  Accessible without login Plain text file css3.css Data Auxiliary data
  Accessible without login Plain text file css4.css Data Auxiliary data
  Accessible without login Plain text file example1.php Example Example script
  Accessible without login Plain text file example2.php Example Example script
  Accessible without login Plain text file example3.php Example Example script
  Accessible without login Plain text file example4.php Example Example script

 Version Control Unique User Downloads Download Rankings  
 93%
Total:8,826
This week:2
All time:170
This week:402Down
User Ratings User Comments (5)
 All time
Utility:81%StarStarStarStarStar
Consistency:80%StarStarStarStarStar
Documentation:71%StarStarStarStar
Examples:69%StarStarStarStar
Tests:-
Videos:-
Overall:62%StarStarStarStar
Rank:939
 
Works! And easy enough to figure out without dox.
2 years ago (F Philip DeGeorge)
67%StarStarStarStar
Very helpful, thank you.
4 years ago (php max)
80%StarStarStarStarStar
lower case for all elements is wrong, as there may be url() w...
5 years ago (Headroom)
72%StarStarStarStar
Very useful class.
6 years ago (Eric Guerin)
62%StarStarStarStar
PHP Version 5.
8 years ago (Shawn Coppock)
15%Star