Last Good Quote: Son's are the seasoning on our lives. - Someone on Facebook

Tuesday, September 9

Display All Images in a Directory

The following php code will allow you to display/show all images in a folder. Be careful as if there is an executable file in this folder it will get executed.

(Just cause I'm tired of searching for it every time I want to do it)

$dir=dir("./images/.");
while($filename=$dir->read())
{
if($filename != "."
&& $filename != ".."
&& $filename != ".."
&& $filename != "Thumbs.db" )
{
print $filename . " - ";
}

Followers