I have thousands of log files in several directories on my system. Basically I need to know only the number of these files in the directory. I am afraid this attitude:
$files = count(scandir("logs")) - 2;
Not very efficient (memory, file system). I am considering some global counter (added after adding a file) if there is no other efficient way?
source
share