Skip to content

Instantly share code, notes, and snippets.

View sushengbuhuo's full-sized avatar

sushengbuhuo sushengbuhuo

View GitHub Profile
@sushengbuhuo
sushengbuhuo / prize.php
Created October 12, 2019 12:25
抽奖功能
function get_rand($proArr) {
$res = '';
//改了数组的总概率精度
$proSum = array_sum($proArr);
//概率数组循环
foreach ($proArr as $k => $v) {
$randNum = mt_rand(1, $proSum);