I have a directory with fullsize images and thumbnails. The thumbnails are prefixed with thumb_
and then share the same name as the full size counterparts.
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.
<?
$dirHandle = opendir("images");
while ($file = readdir($dirHandle)) {
if(!is_dir($file) && strpos($file, '.jpg')>0 || strpos($file, '.gif')>0 || strpos($file, '.png')>0) {
echo ("<a href=images/$file><img src=images/thumb_$file></a>");
}
}
closedir($dirHandle);
?>