Making a tree diagram with PHP

DarkRukia

n00b
Joined
Aug 11, 2005
Messages
59
Yes me and a few people are making a forum system and are in desperate need on how to make a tree diagram with PHP!

youngcoders6go.jpg


Like that^?

Any help?
 
The example you posted, though, just looks like a standard forum heirarchy. That's just whatever data structure you happen to use -- likely, each forum entry includes a "parent" field, so you take the current forum, recurse back through the parents until you hit the root, and then write them out in the opposite order.
 
As for implementation of FILO (first in, last out), just push them onto the stack, when parent's found, start popping.
 
Tawnos said:
As for implementation of FILO (first in, last out), just push them onto the stack, when parent's found, start popping.

You mean LIFO? :confused:
 
FILO == LIFO

I consider it FILO & FIFO, for first in last out and first in first out... FIFO = queue, FILO = stack.
 
Back
Top