Prøv med denne kode:
function getDirList ($dirName) {
$d = dir($dirName);
while($entry = $d->read()) {
if ($entry != "." && $entry != "..") {
if (is_dir($dirName."/".$entry)) {
getDirList($dirName."/".$entry);
} else {
echo $dirName."/".$entry."<br>
\\n";
}
}
}
$d->close();
}
getDirList(".");
Hvis du ikke vil have indholdet af undermapperne vist, kan du jo ændre scriptet:
function getDirList ($dirName) {
$d = dir($dirName);
while($entry = $d->read()) {
if ($entry != "." && $entry != "..") {
if (is_dir($dirName."/".$entry)) {
echo $dirName."/".$entry." (DIR)<br>
\\n";
} else {
echo $dirName."/".$entry."<br>
\\n";
}
}
}
$d->close();
}
getDirList(".");
MVH Jakob Nicolajsen
alias pcnoerd
www.pcnoerd.1go.dk/ | pcnoerd@hotmail.com | ICQ# 178307490