Page 1 of 1

MLM pyramid in php problem

Posted: Tue Dec 08, 2009 11:04 am
by jeshurun
hello, i am really sry abt this but i need help badly,
i may sound lazy but really i am at my wits end :oops:
I need sm1 to explain the logic behind the Muliti Level Marketing pyramid in php, u understand?
what i want to know in anoda way is how do u code for a pyramid like:


Me
/ \
/ \
L1 L1
/ \
/ \
L2 L2
and so on.
NB: L1 & L2 stands for Level 1 and Level 2 respectively.
Thanks

Re: MLM pyramid in php problem

Posted: Tue Dec 08, 2009 12:32 pm
by BlaineSch
Making a pyramid can be pretty simple depending on your approach.

If you know anything about data structures you could make "nodes" and things like that, but since PHP has amazing array features you could endlessly make an array that works like nodes.

A list would simply be a normal array, a pyramid or "tree" would simply be a big multidimensional array. You can easily append more arrays to the array and so forth.