I have a MySQL table with a column "rounds" and each "rounds" has his own photos. Exemple round1 has photos from start=380 end=385. This means it has 6 photos and the name of the photos contains 380,381,382,383,384 or 385 inside.
I use this PHP code to display the photos from the whole folder:
$dirname = "photos";
$images = scandir($dirname);
sort($images,SORT_NUMERIC);
krsort($images);
$ignore = Array(".", "..");
foreach($images as $curimg){
if(!in_array($curimg, $ignore)) {
echo "<p align=\"center\">Photo $curimg</p>";
echo "<img class=\"img-responsive\" src=\"". $dirname . '/' . $curimg ."\">";
}
}
I need some help to adjust my code for it search only photos from the folder that contains inside their name 380,381,382,383,384 or 385.
I think the code below could do it but I don't know how to adjust it with the first code.
$start=380;
$end=385;
for($i=$start; $i<=$end; $i++) {
echo "$i<br>";
}