Echo Images in Directory
$dir = "../directory/";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (false !== ($file = readdir($dh))) {
if ($file != "." && $file != "..") {
echo "<img src=\"".$dir."".$file."\" width=\"150px\" class=\"singlePhoto\">";
}
}
closedir($dh);
}
}
Written by Wayne Roddy
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#