PHP Classes

File: v1/example.php

Recommend this page to a friend!
  Classes of Thomas Björk  >  CSS parser  >  v1/example.php  >  Download  
File: v1/example.php
Role: Example script
Content type: text/plain
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: 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.
Date: 2 months ago
Size: 325 bytes
 

Contents

Class file image Download
<?php
include("cssparser.php");

$css = new cssparser();
$css->ParseStr("b {font-weight: bold; color: #777777;} b.test{text-decoration: underline;}");
echo
$css->Get("b","color"); // returns #777777
echo $css->Get("b.test","color");// returns #777777
echo $css->Get(".test","color"); // returns an empty string
?>

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