I have a directory with files in it. When I count the total of files using the code below it returns the correct number of visible files.
The problem I have is that when I remove these visible files and empty the directory I seem to keep showing me a count of 1 when the directory appears to be empty.
I know that there are hidden directories ( . and ..) but why do you get a count of one?
The reason I ask is that I want to remove the directory if it is empty of visible files - how do i check that it is empty and then remove the directory?
count(glob($absolutepathtodirectory . "/*"));