PHP数组分割成新数组 阿星小栈
2021-06-19 02:08
标签:ice count UNC class nbsp array col style bsp 说明:$arr被分割数组 $num 要分割数 PHP数组分割成新数组 阿星小栈 标签:ice count UNC class nbsp array col style bsp 原文地址:https://www.cnblogs.com/dereckbu/p/9698710.html public static function arrOper ( $arr, $num ) {
$count = count ( $arr );
$return_arr = [];
for ( $i = 0; $i $count / $num; $i ++ ) {
$return_arr[$i] = array_slice ( $arr, $num * $i, $num);
}
return $return_arr;
}