Just curious
$files = glob(cacheme_directory()."*");
foreach($files as $file)
{
$filemtime=filemtime ($file);
if (time()-$filemtime>= 172800)
{
unlink($file);
}
}
I just want to make sure if the code is correct or not. Thanks.
Here is an example of how to do it recursively.
Be aware that you'll run into problems if you have a very large number of files in the directory.
If you think this is likely to affect you, consider using a lower level approach such as
opendir
.