Location: PHPKode > scripts > parseCSS > parsecss/test.php
<?php
include_once("parseCSS.inc");
$oCSS=new CSS();
?>
<html>
</html>

<h3>Parse CSS from File</h3>

<?php

$oCSS->parseFile("style.css");

foreach($oCSS->css as $key0 => $value0) {
	echo "</ul>$key0<ul>\n";
	foreach($oCSS->css[$key0] as $key1 => $value1) {
		echo "\t<li>$key1:$value1\n";
	}
}
?>
</ul><hr>
<h3>Tell me what property has body->font-size<br>
<?=$oCSS->css["body"]["font-size"]?></h3>

<h3>Parse CSS from String</h3>

<hr>

<?php
$string="body {
	font-family: Arial;
	font-size: 10pt;
	font-style: normal;
}

body.top {
	font-family: Arial;
	font-size: 10pt;
	text-decoration: none;
	}";
	
$oCSS->parse($string);
foreach($oCSS->css as $key0 => $value0) {
	echo "</ul>$key0<ul>\n";
	foreach($oCSS->css[$key0] as $key1 => $value1) {
		echo "\t<li>$key1:$value1\n";
	}
}
?>
</ul><hr>
<h3>Generate CSS</h3>
<?php

	$oCSS->css["body"]["background-image"]="url(background2.gif)";
	$oCSS->css["body"]["font-family"]="Times New Roman";
	echo "<PRE>".$oCSS->buildcss()."</PRE>";

?>
<hr>
<h3>What Tags are in array</h3>
<ul>
<?php
foreach($oCSS->csstags as $value0) {
	echo "<li>$value0</li>\n";
}
?>
</ul>
Return current item: parseCSS