如何在php中对具有相同索引的数组元素进行分组

时间:2016-01-09 06:47:43

标签: php arrays

我有以下数组和

Array ( 
    [0] => Array ( [70] => Array ( [0] => d ) ) 
    [1] => Array ( [71] => Array ( [0] => a ) ) 
    [2] => Array ( [71] => Array ( [0] => c ) ) 
    [3] => Array ( [71] => Array ( [0] => d ) ) 
    [4] => Array ( [72] => Array ( [0] => b ) ) 
    [5] => Array ( [73] => Array ( [0] => a ) ) 
    [6] => Array ( [73] => Array ( [0] => c ) ) 
    [7] => Array ( [74] => Array ( [0] => a ) ) 
    [8] => Array ( [75] => Array ( [0] => a ) ) 
)

我想使上面的数组像下面一样

Array (
    [70] => Array ( [0] => c ) 
    [71] => Array ( [1] => b [2] => c ) 
    [72] => Array ( [2] => c ) 
    [73] => Array ( [0] => a [2] => c ) 
    [74] => Array ( [4] => c ) 
    [75] => Array ( [5] => c ) 
    )

请帮助我如何在php中制作这个?

0 个答案:

没有答案