3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ "36736" => [ "meta" => [ "Closing Date" => "", "Technical Consultant" => "", "Client Name" => "", "Stage" => "Waiting for Technical Assignment", "Contract Name" => "", "Signing Rate" => "", "Contract Number" => "", "Client Number" => "", "Closer Name" => "", "Completed On" => "2019-05-23", "Assigned Date" => "05/22/2019 12:28 pm", ], ], ]; $keys = ["Client Name", "Client Number", "Contract Name", "Contract Number", "Stage", "Closing Date", "Technical Consultant", "Signing Rate", "Closer Name", "Completed On", "Assigned Date"]; foreach ($arr as $key => &$value) { // & defines changes will be reflected at its address in memory $value['meta'] = array_replace(array_flip($keys), $value["meta"]); } print_r($arr);die;
Output for 7.1.25 - 7.1.28, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Array ( [36736] => Array ( [meta] => Array ( [Client Name] => [Client Number] => [Contract Name] => [Contract Number] => [Stage] => Waiting for Technical Assignment [Closing Date] => [Technical Consultant] => [Signing Rate] => [Closer Name] => [Completed On] => 2019-05-23 [Assigned Date] => 05/22/2019 12:28 pm ) ) )

preferences:
185.22 ms | 404 KiB | 163 Q