ok, ive been trying to get a good directory listing script. Thing is I only want it to get the folders of a directory and its sub directorys. Not its containing files.
Heres the function im working with
function getDirList_win ($dirName_win) {
$d_win = dir($dirName_win);
$i=0;
while($entry_win = $d_win->read()) {
if ($entry_win != "." && $entry_win != ".." && $entry_win != "cfg.php") {
if (is_dir($dirName_win."\\".$entry_win)) {
getDirList_win($dirName_win."\\".$entry_win);
} else {
//if ($i > 1) {
//} else {
echo "<option>".$dirName_win."</option>";
// $i=1 + $i;
//}
}
}
}
$d_win->close();
return;
}
I have a directory called images and within that directory are 5 images and 1 folder called test. Now I it will only list the main directory name 5 times..
images
images
images
images
images
like so...
it should be
images
images/test