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
The aforementioned code
$count = count(glob("*.{jpg,png,gif,bmp}"));
is your best best, but the {jpg,png,gif} bit will only work if you append the GLOB_BRACE flag on the end:
GLOB_BRACE
$count = count(glob("*.{jpg,png,gif,bmp}", GLOB_BRACE));