//生成下标数组 $numbers = range (0,$ccc); //shuffle 将数组顺序随即打乱 shuffle ($numbers); //array_slice 取该数组中的某一段 $result = array_slice($numbers,0,$params[\'select_num\']); foreach ($result as $r){ $ary[] = $ids[$r]; }
来源:https://www.cnblogs.com/catyxiao/p/15993160.html
本站部分图文来源于网络,如有侵权请联系删除。