> Joe,
>
> Here is a simplified recursive version of your above statement.
>
> <?php
> $dir = '.';
> function displayDir($dir='.') {
> $show = FALSE;
> $results = glob($dir.'/*');
> foreach ( $results AS $entry ) {
> if ( is_dir($entry) && !in_array($entry, array('.', '..')) ) {
> $dirs[] = $entry;
> $show = TRUE;
> }
> }
> if ( $show ) {
> echo '<ul>';
> foreach ( $dirs AS $entry ) {
> echo '<li>', basename($entry);
> displayDir($entry);
> echo '</li>';
> }
> echo '</ul>';
> }
> }
> displayDir($dir);
> ?>
> Hope this helps
> --
> Jim Lucas
Excellent, Jim. Thanks very much for your help.
At the risk of straying too far from the original
subject/call-for-help, is there a way to flag the *first* time the
function runs through a <ul> creation? Though my design doesn't call
for it now, I could see the value of styling the first level
separately than the sub-directories.
Again, thanks very much!
--joe
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php