Hi, I am looking for a script or piece of code that counts the images I have in a folder including the images in the subfolders. I hope someone can help me. Thanks in advance.
Use the script I wrote here: http://forums.digitalpoint.com/showthread.php?t=529171 Together with this: $dir = 'path/to/files'; $files = preg_grep('~\.(jpe?g|bmp|png|gif)$~i', dir_get_contents($dir)); $num_files = sizeof($files); echo "There are {$num_files} images."; PHP:
If the current entry is a file, it'll be added to the files array (which will be returned at the end). And if the current entry is a directory, the function will call itself again and read the files from this directory and add them to the array as well. Oh, and please use [php][/php] tags when posting PHP code.