3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '{ "Status": "success", "data": { "riwayat": [ { "manifest_code": "", "manifest_description": "SHIPMENT RECEIVED BY JNE COUNTER OFFICER AT [MAKASAR]", "manifest_date": "2019-07-30", "manifest_time": "20:15", "city_name": "" }, { "manifest_code": "", "manifest_description": "SHIPMENT PICKED UP BY JNE COURIER [MAKASAR]", "manifest_date": "2019-07-30", "manifest_time": "21:29", "city_name": "" } ] } }'; $jsonToArray = json_decode($json, true); $oldKey = 'manifest_description'; $newKey = 'manifest_description_new'; array_walk($jsonToArray['data']['riwayat'], function(&$v, $k) use ($oldKey,$newKey){ $oldValue = $v[$oldKey]; isset($v[$oldKey]) ? ($v[$newKey] = $oldValue) : ''; }); print_r($jsonToArray);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [Status] => success [data] => Array ( [riwayat] => Array ( [0] => Array ( [manifest_code] => [manifest_description] => SHIPMENT RECEIVED BY JNE COUNTER OFFICER AT [MAKASAR] [manifest_date] => 2019-07-30 [manifest_time] => 20:15 [city_name] => [manifest_description_new] => SHIPMENT RECEIVED BY JNE COUNTER OFFICER AT [MAKASAR] ) [1] => Array ( [manifest_code] => [manifest_description] => SHIPMENT PICKED UP BY JNE COURIER [MAKASAR] [manifest_date] => 2019-07-30 [manifest_time] => 21:29 [city_name] => [manifest_description_new] => SHIPMENT PICKED UP BY JNE COURIER [MAKASAR] ) ) ) )

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:
31.51 ms | 409 KiB | 5 Q