If you have a non-CMS site and wish to combine multiple CSS files into one, this code can get you started.
Simply link to this file instead of your stylesheets directly.
What the code is doing is reading a list of files, combining them into a single string, then writing out the contents to a new ‘combined.css’ file.
It also uses a timestamp to determine if the file should be regenerated. 86400 is the number of seconds in 24 hours.
This is a very simple script. More advanced functionality like comparing the modified file times of the CSS files instead could be added with ease.