Viewing Images inside a folder, but is it possible to link?

0

I have a PHP code which displays all the images in a particular folder, but I would like to know if it is possible to LINKAR with a <a href="link"></a> each image (knowing the order) by determining a sequence in the code or similar to this. Does anyone have any ideas or examples from the code below?

<?php
$pasta = 'img/img_anuncios/';

$arquivos = glob("$pasta{*.jpg,*.png,*.gif,*.bmp}", GLOB_BRACE);
foreach($arquivos as $img){?>
<a target="_blank" href="<?php echo $img; ?>" id="example1"><img class="mySlides w3-animate-fading" src="<?php echo $img; ?>" id="teste1"  style="width: 250px; height: 220px;"/></a>
<?php  }

?>

EDIT:

SOMETHING LIKE IT (HTML):

<a target="_blank" href="LINK" ><img class="mySlides w3-animate-fading" src="img/calcemp_nova.png" id="teste1" style="width: 250px; height: 220px;"></a>
<a target="_blank" href="LINK" ><img class="mySlides w3-animate-fading" src="img/cohncor.png" id="teste1" style="width: 250px; height: 220px;"></a>
<a target="_blank" href="LINK" ><img class="mySlides w3-animate-fading" src="img/indemp_nova.png" id="teste1" style="width: 250px; height: 220px;"></a>
    
asked by anonymous 16.08.2018 / 04:12

0 answers