Is there any way to get only images with extensions jpeg, png, gif etc while using
jpeg
png
gif
$dir = \'/tmp\'; $files1 = scand
You can search the resulting array afterward and discard files not matching your criteria.
scandir does not have the functionality you seek.
scandir