title: Display PNG only files in directory PHP
body: <p>I am having trouble sorting the PNG files in my script.</p>
  
  <pre><code>&lt;?php
  if ($handle = opendir('../banners/')) {
  
      while (false !== ($entry = readdir($handle))) {
  
          if ($entry != "." &amp;&amp; $entry != "..") { ?&gt;
                  &lt;tr&gt;
                      &lt;td&gt;&lt;a href="../banners/&lt;?php echo $entry; ?&gt;" target="_blank"&gt;&lt;img src="../banners/&lt;?php echo $entry; ?&gt;" /&gt;&lt;/a&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;?php echo $entry; ?&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;a href="&lt;?php echo $adminurl; ?&gt;banners/delete/&lt;?php echo $entry; ?&gt;/"&gt;&lt;img src="&lt;?php echo $siteurl; ?&gt;style/images/delete.png" class="delete-icon" alt="Verwijder" /&gt;&lt;/a&gt;&lt;/td&gt;
                  &lt;/tr&gt;
          &lt;?php }
      }
  
      closedir($handle);
  }
  ?&gt;
  </code></pre>
  
  <p>This works fine but it also displays the index.php, PSD files, basically every file.</p>
  
  <p>How can I make it so it only displays .png extension files?</p>