PHP for Matrix MLM programming

Though i tried to talk him out of it, a client wants to incorporate this MLM thing into his membership site, where a member after refering 5 new members will move from
‘Level 0’ to ‘Level 1’, and if each of those members also referred 5 members each, the original member will go from ‘Level 1’ to ‘Level 2’,
and so on. The question is, how do i approach this kind of thing with PHP, what’s the programming logic/schema involved , where can i get tutorials
on php for matrix programming.

Thanks.

What you’re looking for is called a referral script.

Any help?

Here’s some - php user referral