<?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);
You have javascript disabled. You will not be able to edit any code.