Parsing a CSS file?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Monotoko
Forum Commoner
Posts: 64
Joined: Fri Oct 26, 2007 4:24 pm

Parsing a CSS file?

Post by Monotoko »

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...
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: Parsing a CSS file?

Post by jayshields »

Post Reply