PHP – count the number os files in a directory

All files

$countfiles = count(glob($path.'/*'));

just .jpg files

$countfiles = count(glob($path.'/*.jpg'));

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.