I have a code that takes the images from the images/FotosdoWhatsAPP
folder, but it is displaying all the images, I would like to display only a quantity X
(eg 5 images).
<?php
$dirname = "images/FotosWhatsApp/";
$images = glob($dirname."*.{jpg,jpeg,png,gif,JPG,PNG,JPEG,GIF}",GLOB_BRACE);
foreach($images as $image) {
echo '
<a href="'.$image.'" data-at-1920="'.$image.'">
<div class="div-thumbnail-portfolio" style="background-image: url('.$image.');background-repeat: no-repeat;background-size: cover; background-position: center center; " class="thumbnail-detalhe">
</div>
</a>
';
/*<a href="'.$image.'" rel="gallery" class="fresco" data-fresco-group="example">
<img src="'.$image.'" style="background-image: url('.$image.');background-repeat: no-repeat;background-size: cover; background-position: center center; " class="thumbnail-detalhe"/>
</a>*/
}
?>