php数组分组问题 5
有这样一个数组:Array([0]=>Array([0]=>2015[1]=>aaaa1)[1]=>Array([0]=>2015[1]=>aaaa2)[2]=>Arra...
有这样一个数组:
Array
(
[0] => Array
(
[0] => 2015
[1] => aaaa1
)
[1] => Array
(
[0] => 2015
[1] => aaaa2
)
[2] => Array
(
[0] => 2015
[1] => aaaa3
)
[3] => Array
(
[0] => 2015
[1] => aaaa5
)
[4] => Array
(
[0] => 2015
[1] => aaaa7
)
[5] => Array
(
[0] => 2015
[1] => aaaa9
)
[6] => Array
(
[0] => 2016
[1] => aaaa51
)
)
如何操作能变成这样:
$newarray = array(
'2015'=>array(aaaa1,aaaa2,aaaa3,aaaa5,aaaa7,aaaa9),
'2016'=>array(aaaa51)
);
寻高手~~ 展开
Array
(
[0] => Array
(
[0] => 2015
[1] => aaaa1
)
[1] => Array
(
[0] => 2015
[1] => aaaa2
)
[2] => Array
(
[0] => 2015
[1] => aaaa3
)
[3] => Array
(
[0] => 2015
[1] => aaaa5
)
[4] => Array
(
[0] => 2015
[1] => aaaa7
)
[5] => Array
(
[0] => 2015
[1] => aaaa9
)
[6] => Array
(
[0] => 2016
[1] => aaaa51
)
)
如何操作能变成这样:
$newarray = array(
'2015'=>array(aaaa1,aaaa2,aaaa3,aaaa5,aaaa7,aaaa9),
'2016'=>array(aaaa51)
);
寻高手~~ 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询