PHP Classes

CSS parser: CSS parser class

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-01-09 (8 months ago) RSS 2.0 feedStarStarStarStar 63%Total: 9,282 All time: 163 This week: 40Up
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
Age: 56
All time rank: 1581 in Sweden Sweden
Week rank: 164 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 (15)  
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 (15)  /  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 (15)  /  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 (15)  /  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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 93%
Total:9,282
This week:0
All time:163
This week:40Up
User Ratings User Comments (6)
 All time
Utility:82%StarStarStarStarStar
Consistency:81%StarStarStarStarStar
Documentation:70%StarStarStarStar
Examples:72%StarStarStarStar
Tests:-
Videos:-
Overall:63%StarStarStarStar
Rank:771
 
can you please provide little more documentation on how to re...
7 years ago (sachin mohite)
75%StarStarStarStar
Works! And easy enough to figure out without dox.
9 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...
12 years ago (Headroom)
72%StarStarStarStar
Very useful class.
13 years ago (Eric Guerin)
62%StarStarStarStar
PHP Version 5.
15 years ago (Shawn Coppock)
15%Star