时间:2021-07-01 10:21:17 帮助过:13人阅读
$bl = lucker(50);//50%的可能性
var_dump($bl);
function lucker($dot) {
$dot = intval($dot);
$dot = max($dot,0);//min dot = 0
$dot = min($dot,100);//max dot = 100
$one = rand(1,100);
$total = range(1,100);
shuffle($total);
$range = array();
for($i=0; $i<$dot; $i ) {
$range[] = $total[$i];
}
return in_array($one,$range);
}
?>