RE: [PHP] Recursion: Ugh!

2005-05-27 Thread Chris W. Parker
Steve Brown on Friday, May 27, 2005 2:17 PM said: > So in your case, if you wanted to create a new item in the category > "Round", you would first have to navigate to Food > Vegetables > > Round, then create the new item. This may seem more complicated, > but think

Re: [PHP] Recursion: Ugh!

2005-05-27 Thread Steve Brown
** email gagging, sorry if this is a DP ** On 5/27/05, Chris W. Parker <[EMAIL PROTECTED]> wrote: > Let's say you're entering a new product, you'd want to see a list of all > the available categories, not just the last node of a branch. Not neccesarily; it depends on how big your tree structure i

Re: [PHP] Recursion: Ugh!

2005-05-27 Thread Steve Brown
On 5/27/05, Chris W. Parker <[EMAIL PROTECTED]> wrote: > Let's say you're entering a new product, you'd want to see a list of all > the available categories, not just the last node of a branch. Not neccesarily; it depends on how big your tree structure is. If you only have 10 "categories" where a

RE: [PHP] Recursion: Ugh!

2005-05-27 Thread Chris W. Parker
Steve Brown on Thursday, May 26, 2005 11:47 AM said: > How is your structure being built? Is it hard-coded or dynamic (e.g. > pulled from a DB)? >From a database. > We employ a similar "tree" structure for manging > items in our store front. Believe me when I say

Re: [PHP] Recursion: Ugh!

2005-05-27 Thread Steve Brown
> Food:Fruit:Red > Food:Fruit:Green > Food:Fruit:Yellow > Food:Vegetables:Long > Food:Vegetables:Round > Food:Vegetables:Round:Spikey > Food:Vegetables:Round:Smooth How is your structure being built? Is it hard-coded or dynamic (e.g. pulled from a DB)? We employ a similar "tree" structure for ma

Re: [PHP] Recursion: Ugh!

2005-05-27 Thread Chris
Chris W. Parker wrote: Hi everyone, I've been working on a problem for a few days now and I'm not making any headway so I think it's time I come to the list for some help (though this really disappoints me since it appears I'm not capable of solving this problem on my own!). Anyway, I'm using

Re: [PHP] Recursion: Ugh!

2005-05-27 Thread Chris
Chris W. Parker wrote: Hi everyone, I've been working on a problem for a few days now and I'm not making any headway so I think it's time I come to the list for some help (though this really disappoints me since it appears I'm not capable of solving this problem on my own!). Anyway, I'm using

Re: [PHP] Recursion: Ugh!

2005-05-27 Thread Chris
Chris W. Parker wrote: Marek Kilimajer on Thursday, May 26, 2005 11:35 AM said: untested: function display($array, $prefix = '') { echo $prefix ':' . $array['name'] . "\n"; if(is_array($array['children']) && $array['children']) {

Re: [PHP] Recursion: Ugh!

2005-05-26 Thread Rory Browne
This would have been easier if you'd posted the php code to create the array, as opposed to the output of print_r. I did this: 'food', 'children' => array( array( 'name' => 'meat', 'children' =>

RE: [PHP] Recursion: Ugh!

2005-05-26 Thread Chris W. Parker
Marek Kilimajer on Thursday, May 26, 2005 11:35 AM said: > untested: > > function display($array, $prefix = '') { > echo $prefix ':' . $array['name'] . "\n"; > if(is_array($array['children']) && $array['children']) { > foreach($array['child

Re: [PHP] Recursion: Ugh!

2005-05-26 Thread Marek Kilimajer
Chris W. Parker wrote: Hi everyone, I've been working on a problem for a few days now and I'm not making any headway so I think it's time I come to the list for some help (though this really disappoints me since it appears I'm not capable of solving this problem on my own!). Anyway, I'm using t

[PHP] Recursion: Ugh!

2005-05-26 Thread Chris W. Parker
Hi everyone, I've been working on a problem for a few days now and I'm not making any headway so I think it's time I come to the list for some help (though this really disappoints me since it appears I'm not capable of solving this problem on my own!). Anyway, I'm using the Modified Preorder Tree