So, I wrote my own old file getter function. The function will accept either an array of file paths or a string which will be passed to
glob
in order to get an array of file paths. The function returns the oldest file found.function oldest_file($dir)
{
if(is_string($dir))
{
$dir = glob($dir);
}
$oldest = array_shift($dir);
foreach($dir as $file)
{
if(filemtime($file) < filemtime($oldest))
{
$oldest = $file;
}
}
return $oldest;
}
2 comments:
You have scientology ads on your blog.
The ads are "User Targeted" so if you see ads about that it means Google thinks it's something you would be interested in based on what you've been reading and searching for...
I see ads for technology companies. :)
Post a Comment