如何从以下数字列表生成随机数 -
a) 1 to 50 (one from the list)
b) 6, 12, 18, 24, 30 (one from the list)
c) 7, 13, 19, 25, 31 (one from the list)
d) 3 to 75 (one from the list)
答案 0 :(得分:1)
尝试以下内容可以帮助您
$fixarray1 = array(6, 12, 18, 24, 30);
$fixarray2 = array(7, 13, 19, 25, 31);
$arra1 = rand(1, 50);
$arra2 = array_rand($fixarray1,1);
$arra3 = array_rand($fixarray2,1);
$arra4 = rand(3, 75);
echo $arra1."-".$arra2."-".$arra3."-".$arra4;