Recursive Directory Listing



New to PHP development, new to the list; searched the archives but
didn't find an answer (or at least nothing i could successfully
adapt).

I have a (readable) directory structure like so:

.../navigation
/cats
/dogs
/beagles
/collies
/some/other/dirs/
/horses

I need to display those directories in nested html lists (marked up
with css). Using PHP on the above, I'd like to produce the following
HTML:

<ul>
<li>cats</li>
<li>dogs
<ul>
<li><beagles></li>
<li><collies>
<ul><li>some...</li></ul>
</li>
</ul>
</li>
<li>horses</li>
</ul>

I'm able to display one level deep (cats, dogs, horses), but not nest
the lists accordingly. Since this is for a navigation structure,
obviously I'll have anchors in the <li></li> lines. They'll be
formatted like so
href="index.php?section=dogs&chapter=collies&verse=some .

Some details about my environment:
1) no files will be in the /navigation (or sub) dirs, but i'd
(ideally) like to define a depth, to prevent >3-4 levels of
navigation.
2) I can successfully exclude dirs (. and .. and anything else I define)
3) the actual PHP script probably won't be in the /navigation
directory, so I'll need a defined starting path (ie, $root =
/site/docs/includes/navigation/ or somesuch...).
4) no database access (otherwise this whole contraption wouldn't be an issue...)

Any help is greatly appreciated, thank you in advance.
--joe
.



Relevant Pages

  • Re: Ten least secure programs
    ... If you mean something specific like the interface and the PHP ... > lists ZERO, so I'm not too stressed about it. ... > Evaluating SSL VPNs' Consider NEOTERIS, chosen as leader by top analysts! ... > about an hour, with no client, server changes, or ongoing maintenance. ...
    (Security-Basics)
  • Re: PHP and LISPPA technology
    ... No, but if i would worry about that, i would not be using php. ... inheritance, garbage collection, exceptions, blocks, hashed associative, ... > But the assignment statement in PHP creates duplicate of array: ... The article devoted to linked lists. ...
    (comp.lang.php)
  • Re: php xslt for RH9 ???
    ... My objective was to add xslt support to PHP. ... Get Sablotron RPMS from: ... Start Apache web server. ... Look at your Apache error log to see if it lists any problems and make sure ...
    (RedHat)
  • Re: If youre good with arrays and lists, this ones for you
    ... echo "Nope. ... I'm using PHP 4.4.4. ... Let's say I have two scalars, $list1 and $list2. ... Both are comma separated lists of ordered, unsigned, unique integers. ...
    (comp.lang.php)