<?php
// 应用公共文件

function array_split($arr,$num)
{
    $res = [];
    $pre = 0;
    $item = [];
    foreach ($arr as $v) {
        if ($pre != 0 && $pre % $num == 0) {
            $res[] = $item;
            $item = [];
        }
        $item[] = $v;
        $pre++;
    }

    if (!empty($item)) {
        $res[] = $item;
    }

    return $res;
}