bgcolor:
function find_pngs($dir) {
$file_list = '';
$stack[] = $dir;
while ($stack) {
$current_dir = array_pop($stack);
$pngs = false;
if ($dh = opendir($current_dir)) {
while (($file = readdir($dh)) !== false) {
if ($file !== '.' AND $file !== '..') {
$current_file = "{$current_dir}/{$file}";
if (is_file($current_file)) {
if (!(strcmp(substr($file, -4), ".png"))) {
if (!$pngs) {
print "
\n{$current_dir}
\n";
$pngs = true;
}
print "\n";
}
}
elseif (is_dir($current_file)) {
$stack[] = $current_file;
}
}
}
}
}
}
find_pngs(".");
?>
bgcolor: