选出随机的不重复的二十个数
<?php
function NoRand($begin=0,$end=1000,$limit=5){
$rand_array=range($begin,$end);
shuffle($rand_array);//调用现成的数组随机排列函数
return array_slice($rand_array,0,$limit);//截取前$limit个
}
for ($i=0; $i < count(NoRand()); $i++) {
$ss[]=NoRand()[$i];
}
sort($ss);
var_dump($ss);
?>
posted on 2015-07-16 14:50 liuwenbohhh 阅读(177) 评论(0) 收藏 举报
浙公网安备 33010602011771号