My code to get all images from a directory
$dirname = "uploads/";
$images = glob("{$dirname}*.png, {$dirname}*.jpeg, {$dirname}*.jpg, {$dirname}*.gif");
foreach($images as $image) {
echo "<img src='{$image}' class='files_main'>";
}
This works for one type of image but fails with multiple please give the syntax of defining multiple patterns in the glob().