Hi,
I was wondering if anyone could help me out. I am simply trying to create a dropdown list of other directories. Using:
[php]
//SIMPLY as a precurser test, and I UNDERSTAND that this scans directories AND files both, & simply echoes back
$DirList = scandir(’…/ParentDir’);
print_r ($DirList);
[/php]
…I get the following:
Array ( [0] => . [1] => … [2] => .DS_Store [3] => Gallery01 [4] => Gallery02 [5] => Gallery03 [6] => Test_1 )
But, what I eventually want is simply: Gallery01 =>Gallery02 => Gallery03 (without the annoying Mac file, and the “.”, “…” files.
To test my “filter”, I tried:
[php]
$DirList = scandir(’…/path/GalleryImages/’);//this is actually a dir of image dirs
foreach ($DirList as $subdir) {
if(is_dir($subdir)) {
echo “$subdir
”;
}
}
[/php]
The results were echoed as:
“.”
“…”
I filtered out something. But, the target image directories were missing.
If I could figure out how to properly filter out something that doesn’t typically have a suffix (.jpg,tiff, etc…since I’m dealing with directories), I think I know how to build a dropdown menu with the proper results. Can anybody help? Thanks in advance.