3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "metingen": [ { "label": "06-06-2019 13:13:38", "value": 25.21 }, { "label": "06-06-2019 13:51:04", "value": 27.69 }, { "label": "06-06-2019 13:52:04", "value": 27.69 }, { "label": "06-06-2019 13:53:06", "value": 27.61 }]}'; $jToArr = json_decode($json, true); $res = []; foreach($jToArr['metingen'] as $key => $value){ $res[] = ['x' => $value['label'], 'y' => $value['value']]; } print_r($res);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [x] => 06-06-2019 13:13:38 [y] => 25.21 ) [1] => Array ( [x] => 06-06-2019 13:51:04 [y] => 27.69 ) [2] => Array ( [x] => 06-06-2019 13:52:04 [y] => 27.69 ) [3] => Array ( [x] => 06-06-2019 13:53:06 [y] => 27.61 ) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
122.44 ms | 406 KiB | 5 Q