输入banner图图片脚本导航/分类

多维数组-如何在php中将四维数组转化成二维数组如下图

回复内容:

纯手打的,大概就是那么个意思,最好把数据放出来好实际测试一下:

function array_unzip_rescursive($arr) {
    $res = array();
    if(array_key_exists('name', $arr) $res[] = $arr;
    else foreach($arr as $item) $res = array_merge($res, array_unzip_rescursive($item));
    return $res;
}

foreach ($arr['1'] as $row){
    $res[] = $row['0'];
}