欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

php抽奖概率|php概率实现|ProbobAward

程序员文章站 2022-05-23 19:03:22
...

$award = array( 1 = 1, 2 = 3, 3 = 6, 4 = 9, 5 = 12, 6 = 22, 7 = 30, 8 = 50, 9 = 60, 10 =99 ); echogetProbobAward($award); 无 ?phpdefined('ROOT') or exit('Access Denied');class Probob{public function getProbobAward($array){$Sum = array_sum($

$award = array(
1 => 1,
2 => 3,
3 => 6,
4 => 9,
5 => 12,
6 => 22,
7 => 30,
8 => 50,
9 => 60,
10 => 99
);
echo getProbobAward($award);
 $prob){
			$Rand = mt_rand(1, $Sum);
			if($Rand