Strangely when I tried to google this question entering queries similar to this question nothing useful popped out, not even close.
Now I am not looking for a solution where you scan or open directory and read its contents file by file. For those looking for such inreliable loop, checkout these functions: scandir(...)
to load all at once and then loop it, and opendir(...)
, readdir(...)
, stat(...)['mtime']
to do it file by file and possibly setting some limit on how many is done and make it at least a bit safer...
What I would like to know is whether there is something in PHP that could check/test, in some simple way, whether a folder/directory contains file older than [sometime], or even how many of such files are there without any kind of "manual" go-through?
PS: I've seen some shell_exec
s but that does not seem quite cross-OS...