title: Pull all images from a specified directory and then display them
body: <p>How to display the image from a specified directory? like i want to display all the png images from a directory, in my case my directory is media/images/iconized.</p>
  <p>I tried to look around but seems none of them fits what i really needed.</p>
  <p>But here's my try.</p>
  <pre><code>$dirname = &quot;media/images/iconized/&quot;;
  $images = scandir($dirname);
  $ignore = Array(&quot;.&quot;, &quot;..&quot;);
  foreach($images as $curimg){
      if(!in_array($curimg, $ignore)) {
          echo &quot;&lt;img src='media/images/iconized/$curimg' /&gt;&lt;br&gt;\n&quot;;
      }
  }
  </code></pre>
  <p>hope someone here could help. Im open in any ideas, recommendation and suggestion, thank you.</p>