displaying only thumbnails in directory, but linking to full size image
<p>I have a directory with fullsize images and thumbnails. The thumbnails are prefixed with <code>thumb_</code> and then share the same name as the full size counterparts.</p>

<p>What do i need to do the script below to get both the full image and the thumb, so i can echo the correct link? As is, it returns all images.</p>

<pre><code>&lt;?
   $dirHandle = opendir("images");
   while ($file = readdir($dirHandle)) {
      if(!is_dir($file) &amp;&amp; strpos($file, '.jpg')&gt;0 || strpos($file, '.gif')&gt;0 || strpos($file, '.png')&gt;0) {
         echo ("&lt;a href=images/$file&gt;&lt;img src=images/thumb_$file&gt;&lt;/a&gt;");
      }
   } 
   closedir($dirHandle);
?&gt;
</code></pre>
