title: How to search images by name inside a folder?
body: <p>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.</p>
  
  <p>I use this PHP code to display the photos from the whole folder:</p>
  
  <pre><code>$dirname = "photos";
  $images = scandir($dirname);
  sort($images,SORT_NUMERIC);
  krsort($images);
  $ignore = Array(".", "..");
  
  foreach($images as $curimg){
      if(!in_array($curimg, $ignore)) {
  
          echo "&lt;p align=\"center\"&gt;Photo $curimg&lt;/p&gt;";
          echo "&lt;img class=\"img-responsive\" src=\"". $dirname . '/' . $curimg ."\"&gt;";
      }
  }
  </code></pre>
  
  <p>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.</p>
  
  <p>I think the code below could do it but I don't know how to adjust it with the first code.</p>
  
  <pre><code>$start=380;
  $end=385;
  
  for($i=$start; $i&lt;=$end; $i++) {
  echo "$i&lt;br&gt;";
  }
  </code></pre>