- json_decode: documentation ( source)
- print_r: documentation ( source)
<?php
$x = json_decode('[{"value": "2310", "label": "Root >> test" },{"value": "2314", "label": "Root >> TV >> test" }]', true);
$result = [];
foreach($x as $y) {
$result[$y['value']] = $y['label'];
}
print_r($result);