How to group identical keys and values in an array?
There may be N arrays inside the array, you can not add the same keys.
For example:
[attributes] => Array
(
[0] => Array
(
[title] => Cor
[type] => text
[values] => Array
(
[1] => Amarelo
)
)
[1] => Array
(
[title] => Cor
[type] => text
[values] => Array
(
[2] => Azul
)
)
[2] => Array
(
[title] => Largura
[type] => text
[values] => Array
(
[2] => Grande
)
)
Desired result:
[attributes] => Array
(
[0] => Array
(
[title] => Cor
[type] => text
[values] => Array
(
[1] => Amarelo
[2] => Azul
)
)
[2] => Array
(
[title] => Largura
[type] => text
[values] => Array
(
[2] => Grande
)
)