I am building up a simple PHP script to get all my site css/js files combined.
What I would like to do now is checking for the most recent built css or js file in the "cache" folder.
So... some function like:
function getLastFile('js'){
return the js file name
}
function getLastFile('css'){
return the css file name
}
I've found out solutions on the net on how to check for the last file in some folder... but how can I exactly check the last by a specific extension?
if u mean last as most recent built
//get the last-modified-date of this very file
$lastModifiedTime=filemtime($Cachedfile);
or better have a look over the smartoptimizer Code , have a tiny look through its source u will surely get an idea