Good day to you all,
I’m working on a kind of menu script, in fact it read through a directory and return the files and folder, recursively,(PHP) in a unordered list format (HTML).
My question is how can style my unordered list to look like a multi level menu ?
<?php
function writeFileList($dir) {
$dir = $dir."/";
$folder = opendir($dir);
//ignore hidden files and ., ..
echo "<ul>";
while ($f = readdir($folder)) {
if ($f[0] != '.') {
if (is_dir($dir.$f) == 1) {
echo "<li><b>$f</b>";
writeFileList($dir.$f);
echo "</li>";
} else {
echo "<li>$f</li>";
}
}
}
echo "</ul>";
}
$base = 'Art/SKYDOME';
writeFileList($base)
?>
Thnaks !