As far as you know PHP has a random function which everyone can use it.
<?php rand(min,max); ?>
Now My question is How can I define gravity to specific number?
for example, rand(0,100) returns really random number between min and max and unforeseeable what number will be chosen,I use rand in 10 loops and result is:
28,41,2,94,65,23,47,97,59,69,32
Now I want to have a rand number near to specific number for example, rand(0,20). Near to 10 with for example a rage with 4 numbers length.
1,6,12,15,7,8,20,12,10,9,20
As you can See most of numbers is near to 10 but there is 1 and even 20.
I have no idea to write a random function with Below criteria:
1- to what number must be near? 10
2- What range is near? 4
3- How much percentage of this number near to specific number? 70%