Sure, try the function below. It will return an array of sub dir's and then you can go through and create a link to each one. Give it a try.
<?php
function list_dirs($dir)
{
if ($dh = opendir($dir)) { // Open the dir to read..
$dirs = array(); // Initialize empty array.
while (($item = readdir($dh)) !== false) { // Read each item in the dir..
if (is_dir($dir.'/'.$item) && !in_array($item, array('.','..'))) { // If it's a dir..
$dirs[] = $item; // Add the dir name to the list.
}
}
closedir($dh); // Close the directory handle.
} else { // If couldn't open dir, throw error and return false.
trigger_error("list_dirs() Could not open the directory to read. [{$dir}]", E_USER_WARNING);
return(false);
}
return($dirs);
}
$dirs = list_dirs(dirname(__FILE__)); // Get a list of sub dirs.
sort($dirs); // Sort the list.
foreach ($dirs as $name) { // Print a link to each.
print("<a href=\"./{$name}\">".ucwords(str_replace('_', ' ', $name))."</a><br>\r\n"); // For the link text, replace _ with spaces and capitolize all the words.
}
?>