PHP Classes

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 (15)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (4 days ago) RSS 2.0 feedStarStarStarStar 64%Total: 9,255 All time: 162 This week: 108Up
Version License PHP version Categories
cssparser 2.0.10GNU 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
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:9,255
This week:0
All time:162
This week:108Up
User Ratings User Comments (6)
 All time
Utility:84%StarStarStarStarStar
Consistency:82%StarStarStarStarStar
Documentation:71%StarStarStarStar
Examples:73%StarStarStarStar
Tests:-
Videos:-
Overall:64%StarStarStarStar
Rank:869
 
can you please provide little more documentation on how to re...
6 years ago (sachin mohite)
75%StarStarStarStar
Works! And easy enough to figure out without dox.
8 years ago (F Philip DeGeorge)
67%StarStarStarStar
Very helpful, thank you.
11 years ago (php max)
80%StarStarStarStarStar
lower case for all elements is wrong, as there may be url() w...
11 years ago (Headroom)
72%StarStarStarStar
Very useful class.
12 years ago (Eric Guerin)
62%StarStarStarStar
PHP Version 5.
14 years ago (Shawn Coppock)
15%Star