【从二维数组中获取指定数量的数据】

//随机获取200作为当天需要显示的总数据
$lastData=call_user_func(function($data,$num){
$temp=array_rand($data,$num);
//重组数组
foreach($temp as $val){
     $data_last[]=$data[$val];
}
   return $data_last;
},$data,200);
原文地址:https://www.cnblogs.com/fyandy/p/10065791.html