如何将一组数组值组合成一个数组? [英] How to combine array of array values into one array?

查看:170
本文介绍了如何将一组数组值组合成一个数组?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下数组,

Array
(
    [14289] => Array
        (
            [0] => Ability||STROKE CLINIC,Session||Session #3: Tues June 28th - Fri July 8th (9-2:00PM),Time||#1 only: 2pm,child1||FC
            [1] => Ability||N/S++,Session||Session #3: Tues June 28th - Fri July 8th (9-2:00PM),Time||#1 only: 2pm,child2||SC
            [2] => Ability||B-,Session||Session #3: Tues June 28th - Fri July 8th (9-2:00PM),Time||#1 only: 2pm,child3||TC
        )

    [14279] => Array
        (
            [0] => Ability||STROKE CLINIC,Session||Session #1: Tues May 31st - Fri June 10th (1-5:30PM),Time||#1 only: 1pm,child1||FC
            [1] => Ability||N/S++,Session||Session #1: Tues May 31st - Fri June 10th (1-5:30PM),Time||#1 only: 1pm,child2||SC
            [2] => Ability||B-,Session||Session #1: Tues May 31st - Fri June 10th (1-5:30PM),Time||#1 only: 1pm,child3||TC
        )

    [14284] => Array
        (
            [0] => Ability||STROKE CLINIC,Session||Session #2: Tues June 14th - Fri June 24th (9-2:00PM),Time||#1 only: 1:30pm,child1||FC
            [1] => Ability||N/S++,Session||Session #2: Tues June 14th - Fri June 24th (9-2:00PM),Time||#1 only: 1:30pm,child2||SC
        )

)

我需要如下所示的数组,

i need this array as below,

Array
(


            [0] => Ability||STROKE CLINIC,Session||Session #3: Tues June 28th - Fri July 8th (9-2:00PM),Time||#1 only: 2pm,child1||FC
            [1] => Ability||N/S++,Session||Session #3: Tues June 28th - Fri July 8th (9-2:00PM),Time||#1 only: 2pm,child2||SC
            [2] => Ability||B-,Session||Session #3: Tues June 28th - Fri July 8th (9-2:00PM),Time||#1 only: 2pm,child3||TC
            [3] => Ability||STROKE CLINIC,Session||Session #1: Tues May 31st - Fri June 10th (1-5:30PM),Time||#1 only: 1pm,child1||FC
            [4] => Ability||N/S++,Session||Session #1: Tues May 31st - Fri June 10th (1-5:30PM),Time||#1 only: 1pm,child2||SC
            [5] => Ability||B-,Session||Session #1: Tues May 31st - Fri June 10th (1-5:30PM),Time||#1 only: 1pm,child3||TC          
            [6] => Ability||STROKE CLINIC,Session||Session #2: Tues June 14th - Fri June 24th (9-2:00PM),Time||#1 only: 1:30pm,child1||FC
            [7] => Ability||N/S++,Session||Session #2: Tues June 14th - Fri June 24th (9-2:00PM),Time||#1 only: 1:30pm,child2||SC


)

我该怎么做?

推荐答案

$result = array();
foreach($array as $item) {
    $result = array_merge($result, $item);
}

这篇关于如何将一组数组值组合成一个数组?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆