adapted from http://us3.php.net/manual/en/function.opendir.php
<?php
$dir = "/tmp/";
// Open a known directory, and proceed to read its contents
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
if(is_dir($file)) echo "directory: $file <br>"; // only display if it's a folder
}
closedir($dh);
}
}
?>