3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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);
based on NS8d0
Output for 5.6.38 - 7.3.0rc3
Array ( [2310] => Root >> test [2314] => Root >> TV >> test )