i got response (json) from web service and converted / decoded it into php array.
converted array php:
$data = [
[
'id' => '01',
'name' => 'ABC',
'label' => 'color',
'value' => '#000000'
],[
'id' => '01',
'name' => 'ABC',
'label' => 'active',
'value' => true
],[
'id' => '02',
'name' => 'DEF',
'label' => 'color',
'value' => '#ffffff'
],[
'id' => '02',
'name' => 'DEF',
'label' => 'active',
'value' => false
]
];
expected array output:
$data = [
[
'id' => '01',
'name' => 'ABC',
'color' => '#000000',
'active' => true,
],[
'id' => '02',
'name' => 'DEF',
'color' => '#ffffff',
'value' => false
]
];
What php function is suitable for that case? thanks in advance
foreachis involved, did you try it out?