outputting multi-dim array



I'm building a nav structure in PHP that's using simplified XML files
to populate an unordered list. I have an xml parser that coverts my XML
to a multi-dimensional array, but I'm having issues getting by data out
of that array.

My xml file looks something like this:

<SECTION title="Search Engines">
<ITEM name="Google" url="www.google.com" />
<ITEM name="Yahoo" url="www.yahoo.com" />
</SECTION>
<SECTION title="Boogers">
<ITEM name="Slimy" url="slimy.com" />
<ITEM name="Crunchy" url="crunchy.com" />
</SECTION>

I'm very used to using a for loop over single-dim arrays but not so
much on mult-dim arrays. I'd like to output something like this:

<li class="title">Search Engines</li>
<li><a href="www.google.com">Google</a></li>
<li><a href="www.yahoo.com">Yahoo</a></li>
<li class="title">Boogers</li>
<li><a href="slimy.com">Slimy</a></li>
<li><a href="crunchy.com">Crunchy</a></li>

I've been looking at examples and pouring over php.net's docs to no
avail, and can't seem to get a loop structure that'll output what seems
like a very simple multi-dim array structure.
Can anyone point me in the right direction for that loop, or suggest a
better way for me to go about this?

.



Relevant Pages

  • Re: newbie: Need feedback about this!
    ... I have an array of strings which I need to send in as a parameter to a ... But I think a stored procedure accepts xml files as a ...
    (microsoft.public.dotnet.languages.csharp)
  • newbie: Need feedback about this!
    ... I have an array of strings which I need to send in as a parameter to a ... But I think a stored procedure accepts xml files as a ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: newbie: Need feedback about this!
    ... Yet another approach is to send the array of strings as a single delimited ... But I think a stored procedure accepts xml files as a ...
    (microsoft.public.dotnet.languages.csharp)
  • holding multiple values in an array
    ... While parsing a XML files I need to hold some of the values in an array till the end of the iteration. ...
    (comp.lang.java.programmer)
  • Parsing large XML file
    ... I was planning on using the XML::Twig module to do this, using the following code snip to loop through each of the ... I've never really worked with XML files this large and complex tree. ... Thunder Rain Internet Publishing ...
    (perl.beginners)