php 随机数

$numbers = range (1,30);
//播下随机数发生器种子,可有可无,测试后对结果没有影响
srand ((float)microtime()*10000);
shuffle ($numbers);
unset($numbers[0]);
arr=array_rand($numbers,1);
echo arr;

评论

暂无评论