//define the path as relative
$path = "./";
//using the opendir function
$dir_handle = @opendir($path) or die("Unable to open $path");
// echo "Directory Listing of $path
";
echo "When they were young ...
Photos from Barb ...
";
//running the while loop
while ($file = readdir($dir_handle))
{
if (preg_match('/\.png/', $file)) {
echo "$file
";
}
}
//closing the directory
closedir($dir_handle);
?>