jaxbrian
asked on
readdir() question
I am trying to use the readdir() function to read all the content of a folder so I can display the images like in the code below. when i use this function it always gives me a " . " and a " .. " How do I not include them in the results?
thanks for any help with this
B
thanks for any help with this
B
$dir = opendir("photos/food");
while (($file = readdir($dir)) !== false)
{
echo "<a href=\"photos/food/" . $file . "\"" . "rel=\"lightbox[vacation1]\" title=\"\">
<img src=\"photos/food/" . $file . "\"" . "alt=\"\" height=\"50px\" width=\"50px\"/>
</a>";
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if ($file<>'.' && $file<>'..')
is
if ( $file is not equal to '.' and $file is not equal to '..' )
ASKER