Is there a better/simpler way to find the number of images in a directory and output them to a variable?
function dirCount($dir) { $x = 0; while (($file
I use this to return a count of ALL files in a directory except . and ..
return count(glob("/path/to/file/[!\.]*"));
Here is a good list of glob filters for file matching purposes.