Добрый день, есть массив такого рода
Array
(
[0] => stdClass Object
(
[id] => 96484ce6f0448b5e69e0914952d86692
[name] => ACCENT 06: -SEP.2006 (2006-)
[description] => Production date: 2005/09/01 - ;
Body Type: 3 DR SEDAN;
Grade: MIDDLE GRADE;
Engine Capacity: 1600 CC;
Fuel Type: MPI-DOHC;
Transmission: 4 SPEED AT 2WD
[modelId] => 271dcfb3e2a606e7d0090f06c223622b
[catalogId] =>
[parameters] => Array
(
[0] => stdClass Object
(
[key] => year
[name] => Год
[value] => 2009
[idx] => d99c1ef4a1f82f4b1734915ef51308c7
)
[1] => stdClass Object
(
[key] => body_type
[name] => Кузов
[value] => 3 DR SEDAN
[idx] => 164de21ece278939e9ef7efba14a0b94
)
[2] => stdClass Object
(
[key] => grade
[name] => Градация
[value] => MIDDLE GRADE
[idx] => ac4ec6e90ac4eba974a07206b1805443
)
)
)
[1] => stdClass Object
(
[id] => bd4b345d500cd2e8808ccb95414178b6
[name] => ACCENT 06: -SEP.2006 (2006-)
[description] => Production date: 2005/09/01 - ;
Body Type: 3 DR SEDAN;
Grade: HIGH GRADE;
Engine Capacity: 1600 CC;
Fuel Type: MPI-DOHC;
Transmission: 5 SPEED MT 2WD
[modelId] => 271dcfb3e2a606e7d0090f06c223622b
[catalogId] =>
[parameters] => Array
(
[0] => stdClass Object
(
[key] => year
[name] => Год
[value] => 2010
[idx] => d99c1ef4a1f82f4b1734915ef51308c7
)
[1] => stdClass Object
(
[key] => body_type
[name] => Кузов
[value] => 5 DR SEDAN
[idx] => 164de21ece278939e9ef7efba14a0b94
)
[2] => stdClass Object
(
[key] => grade
[name] => Градация
[value] => HIGH GRADE
[idx] => 712fd6e816552024d1f60687e0cb4914
)
)
)
)
Нужно сгруппировать данные для фильтра, в новый массив такого вида
(
[0] => stdClass Object
(
[key] => year
[name] => Год
[idx] => d99c1ef4a1f82f4b1734915ef51308c7
[value] =>[2009,2010,...]
)
[1] => stdClass Object
(
[key] => body_type
[name] => Кузов
[idx] => 164de21ece278939e9ef7efba14a0b94
[value] =>[3 DR SEDAN,5 DR SEDAN,...]
)
[2] => stdClass Object
(
[key] => grade
[name] => Градация
[idx] => 712fd6e816552024d1f60687e0cb4914
[value] => [HIGH GRADE,MIDDLE GRADE,...]
)
)
Подскажите, как это реализовать?