Hi.
I'm not entire sure what you are talking about...
Are you trying to parse actually CSS code into PHP and echo the the results in a table?
To do that you may want to familiarize yourself with some of the String Functions. Most important of which are stripos, substr and explode
Unless you want to go with some sort of regex solution, in which case I'm close to useless :P
well, this is something.
I want exactly what you understand ( parse actually CSS code into php .. etc ).
I don't want to create a unique table for css.
just one column with type MEDIUMTEXT in a table.
in fact I tried this php code :
( forget about mysql right now , let's make the next code working, if so, i can try it in mysql myself )
[PHP]<?php
$css_is = "
body
{
background: #FEFDF0;
color: #000000;
font: bold 12pt arial;
margin: 0px 0px 0px 0px;
padding: 0px;
}
.special
{
background: #FAF1D5 url(images/design-body.jpg) repeat-x top left;
color: #000000;
font: bold 8pt tahoma;
}
";
/*
NOW we have a text variable which contains CSS code. Which we want to break it into <td>s like
<table><tr>
<td>body></td>
<tr>
<td>background</td><td>#FAF1D5 url(images/design-body.jpg) repeat-x top left</td>
</tr>
and so on.
*/
$css_parsed = explode("\n",$css_is);
foreach($css_parsed as $css_now)
{
// my stupid old code was here;
}
?>[/PHP]
lets say when I use echo ,it prints the
{ symbol as well . I don't now how to extract only the class name and the class properities into
[PHP]$some_array[$class_name][$class_properities][/PHP]
I tried also [PHP]preg_match_all("/[(.*)][\{(.*)\}]/",$css_is ,$css_parsed );[/PHP]
now it prints $css_parsed like separated letters each letter printed in one line .
what i want from this code : is to create a html table filled in with $some_array.
I don't want to cry.
hope i explained it well.