Jump to content

Creating CSS file for group of PHP files


amites

Recommended Posts

Hello,

 

I'm rather new to writing Regex and have a simple request,

 

what I have is a collection of scripts that I wrote rather quickly, now the scripts work and place things inside of different div boxes and other class and id definitions,

 

however I Haven't created a css file to format everything and I'd like to create a function to parse a folder searching for all class names matching

 

class="[class name]"

 

and id names matching

 

id="[id name]"

 

then run that group through a foreach loop to write to a css file

 

.[class name] {

}

 

#[id name] {

}

 

I can handle the opening the directory, and parsing the array once it's been built from preg_match_all though building the regex query itself is giving me some trouble, probably has to do with the 15 hour day I've pulled so far *heh*

 

any help is appreciated

Link to comment
Share on other sites

I was planning on building this into a php function and running it on my computer,

 

if it works probably release it open source, seems like a simple way to save some time when building larger projects,

 

not have to deal with tracking CSS classes and ID's just using good labels

 

I'll see how that works

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.