Scan a directory and retrieve images with PHP

Simple!

$images = glob('/folder/*.{jpg,jpeg,gif,png}', GLOB_BRACE);

glob

(PHP 4 >= 4.3.0, PHP 5)

glob — Find pathnames matching a pattern 

Leave a Reply

Your email address will not be published. Required fields are marked *

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