I have the code below that lists all the images in a folder, the problem is that it finds some files ( a . and a ..) that I am not sure what they are so I a
glob() is case sensitive and the wildcard * will return all files, so I specified the extension here so you don't have to do the filtering work
*
$d = 'path/to/images/'; foreach(glob($d.'*.{jpg,JPG,jpeg,JPEG,png,PNG}',GLOB_BRACE) as $file){ $imag[] = basename($file); }