How to transform an one-dimensional key in a two-dimensional array as the value of a two-dimensional key?

this is the initial array:

$arr = array(
        "CC"=>array(
            "recharge_status"=> 1,
            "withdraw_status"=> 1,
            "trade_status"=> 1,
            "withdraw_fee"=> 0.01,
            "precision"=> 7,
        ),
        "DD"=>array(
            "recharge_status"=> 2,
            "withdraw_status"=> 2,
            "trade_status"=> 2,
            "withdraw_fee"=> 0.02,
            "precision"=> 8,
        ),
        "EE"=>array(
            "recharge_status"=> 3,
            "withdraw_status"=> 3,
            "trade_status"=> 3,
            "withdraw_fee"=> 0.03,
            "precision"=> 9,
        ),
    );

the expected result is:

$newarr = array(
        0=>array(
            "asset_code"=> "CC",
            "recharge_status"=> 1,
            "withdraw_status"=> 1,
            "trade_status"=> 1,
            "withdraw_fee"=> 0.01,
            "precision"=> 7,
        ),
        1=>array(
            "asset_code"=> "DD",
            "recharge_status"=> 2,
            "withdraw_status"=> 2,
            "trade_status"=> 2,
            "withdraw_fee"=> 0.02,
            "precision"=> 8,
        ),
        2=>array(
            "asset_code"=> "EE",
            "recharge_status"=> 3,
            "withdraw_status"=> 3,
            "trade_status"=> 3,
            "withdraw_fee"=> 0.03,
            "precision"=> 9,
        ),
    );



Php
Apr.02,2021

$arr = array(
  'CC' => array(
    'recharge_status' => 1,
    'withdraw_status' => 1,
    'trade_status' => 1,
    'withdraw_fee' => 0.01,
    'precision' => 7,
  ),
  'DD' => array(
    'recharge_status' => 2,
    'withdraw_status' => 2,
    'trade_status' => 2,
    'withdraw_fee' => 0.02,
    'precision' => 8,
  ),
  'EE' => array(
    'recharge_status' => 3,
    'withdraw_status' => 3,
    'trade_status' => 3,
    'withdraw_fee' => 0.03,
    'precision' => 9,
  ),
);

$result = [];

foreach ($arr as $key => $value) {
  $value['asset_code'] = $key;
  $result[] = $value;
}

print_r($result);
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e424e5-599f2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e424e5-599f2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?