MLM pyramid in php problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jeshurun
Forum Newbie
Posts: 5
Joined: Wed Dec 02, 2009 5:37 am

MLM pyramid in php problem

Post 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
User avatar
BlaineSch
Forum Commoner
Posts: 28
Joined: Sun Jun 07, 2009 4:28 pm
Location: Trapped in my own little world.

Re: MLM pyramid in php problem

Post 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.
Post Reply