I've got a chunk of code that I use to list all directories and files:
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
echo "filename: $file : filetype: " . filetype($dir . $file) . "\n";
}
closedir($dh);
}
}
Which in itself does what I want, but now all I want to do is return only the directory names and also display a pre-defined image name if it is present within the directory.
Any ideas guys??