3v4l.org

run code in 300+ PHP versions simultaneously
<?php $response ='[ { "userSummaries": [ { "id": "9910", "status": "Active", "name": "Jhon" } ] }, { "userSummaries": [ { "id": "8754", "status": "Active", "name": "Jane" } ] } ]'; $myArr = json_decode($response, true); $result_arr = []; array_walk($myArr,function($v,$k) use (&$result_arr){ $result_arr[key($v)] = $v[key($v)]; }); echo json_encode($result_arr);

preferences:
24.57 ms | 407 KiB | 5 Q