7
I want to list the image files of a folder, but the first two links that are generated appear like this:
<img class="mySlides" src="Arifureta-shokugyou/capitulo-2/." style="width:100%" />
<img class="mySlides" src="Arifureta-shokugyou/capitulo-2/.." style="width:100%" />
The rest appears the normal link, but the first two always appear with this bug, I do not know how to solve.
Code:
<div class="w3-content" id="box-slider" style="max-width:800px">
<img class="mySlides" src="public/assets/img/1.jpg" style="width:100%" />
<?php
$path = "Arifureta-shokugyou/capitulo-2/";
$diretorio = dir($path);
$diretorio = $diretorio;
while($arquivo = $diretorio -> read()){
$img = '<img class="mySlides" src="' . "$path" . "$arquivo" . '" style="width:100%" /> ';
echo $img;
}
$diretorio -> close();
?>
</div>
I’ll answer that one too
– Wallace Maxters