I am looking for a small bit of php code which counts the number of jpg, png, gif and bmp files in a directory and outputs the answer in 1 number.
+rep for anyone who can help.

I am looking for a small bit of php code which counts the number of jpg, png, gif and bmp files in a directory and outputs the answer in 1 number.
+rep for anyone who can help.
That will say how many files are in a folder...PHP Code:<?php
$directory = "gallery/images/";
$filecount = count(glob("" . $directory . "*.*"));
echo "Images in Gallery: $filecount";
?>
Gl
The sky is the limit, but you can touch the moon if you try.
Zimbu Gaming || The way games should be played!
Thanks+rep
Want to hide these adverts? Register an account for free!