i have tried to write the following function using PHP Recursive Directory Iterator.
$dir = dirname(__FILE__);
$iterator = new RecursiveDirectoryIterator($dir);
foreach (new RecursiveIteratorIterator($iterator, RecursiveIteratorIterator::CHILD_FIRST) as $file) {
if (!$file->isFile()) {
echo "<a href=". $file->getPath().">" . $file->getPath() . "\</a>";
}
}
but what i want is users may click on links to browse any sub-directory below the root directory.