Re: HTML_Menu - Menu Array

From: Date: Tue, 08 Jun 2004 00:32:02 +0000
Subject: Re: HTML_Menu - Menu Array
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-12985@lists.php.net to get a copy of this message
> I have data I have retrieved from a table which is in this format: > ID TITLE URL PARENT which is saved into an array called $all_links, > and I'm trying to get it into a multidimensional array as described in the > document. I'm getting quite a headache trying to work out how. Here is > what I have so far: I was asked off list to provide the data in $all_links so here is: +----+------------------------------+------------+--------+ | id | url | title | parent | +----+------------------------------+------------+--------+ | 1 | index.htm | Home | 0 | | 4 | services/index.htm | Services | 0 | | 2 | http://mungbeans.typepad.com | Blog | 0 | | 3 | contactus.htm | Contact Us | 0 | | 5 | services/domains.htm | Domains | 4 | | 6 | services/websites.htm | Websites | 4 | | 7 | services/australia.htm | Australian | 5 | | 8 | services/us.htm | US | 5 | +----+------------------------------+------------+--------+ As you can see, this data goes down three levels: 1 | Home 2 | Services 21 | Services|Domains 211 | Services|Domains|Australian 212 | Services|Domains|US 22 | Services|Websites 3 | Blog 4 | Contact Us Cheers Leonie

« previous php.pear.general (#12985) next »