I've this array:
Array
(
[0] => Array
(
[id] => 99
[fruit] => Apple
[color] => Green
)
[1] => Array
(
[id] => 99
[fruit] => Apple
[color] => Red
)
[2] => Array
(
[id] => 555
[fruit] => Banada
[color] => Yellow
)
)
I need to create a new array from this one by merging item by id
.
So the final output is the following:
Array
(
[99] => Array
(
[id] => 99
[fruit] => Apple
[color] => Green
),
(
[id] => 99
[fruit] => Apple
[color] => Red
)
[555] => Array
(
[id] => 555
[fruit] => Banada
[color] => Yellow
)
)
Thanks.