Parsing a CSS file?
Posted: Wed Nov 25, 2009 7:46 am
Hiya guys...im trying to make a simple theme editor for people to use, rather than editing the CSS and PHP themselves (which can be deadly if they dont know what there doing...)
I have a script which allows the user to insert HTML code into the template, when the you press okay, it builds a PHP document from a template then adds the bits in that the user has put in.
But i cant seem to change the fonts without manually editing the class part of the tags (which goes to the CSS file)
I was wondering if it was possible within the realms of PHP to grab the CSS code (i know this is possible with a file_get_contents() ) but then i need to parse it, get each part out and list them in a dropdown and allow the user to choose which fonts they want from the CSS, without manually editing it themselves...
I have a script which allows the user to insert HTML code into the template, when the you press okay, it builds a PHP document from a template then adds the bits in that the user has put in.
But i cant seem to change the fonts without manually editing the class part of the tags (which goes to the CSS file)
I was wondering if it was possible within the realms of PHP to grab the CSS code (i know this is possible with a file_get_contents() ) but then i need to parse it, get each part out and list them in a dropdown and allow the user to choose which fonts they want from the CSS, without manually editing it themselves...