假设我有这个print_r
输出,这是动态的,并且每个条件都不相同
Array
(
[2] => Array
(
[1] => 24
[2] => 23,25
)
[3] => Array
(
[3] => 27
[4] => 27,26
[5] => 28,27,26
)
)
如您所见,数组元素[3]
从开始,如果第二个元素不相同[3][4][5]
,如何使它从开始。[1][2]...[n]
理想情况下,我正在寻找的是类似
Array
(
[2] => Array
(
[1] => 24
[2] => 23,25
)
[3] => Array
(
[1] => 27
[2] => 27,26
[3] => 28,27,26
)
)
我如何做到这一点?谢谢