Save me from writing 500 lines of if/else statements in PHP? : I am in a big trouble,
Me and my friend doing a mini project that.How a Person is popular in his city.

**My situation**
How the algorithm should work like
If a person "mark" has 500 friends in his city out of 500,000.

(500/500,000)*50,000 = 5

So 5 in 50,000 people Know him right.

But When  friends count increase the 50,000 should decrease

like:-

If "sam" has 1000 friends then

(1000/500,000)*25000 = 5

So 5 in 25000 people know his name

Yes we could implement this in if/else condition 
If so then i have to write 500 lines of code.

Is there is a another way to do this in PHP.

Help !



