replace array keys with given respective keys

前端 未结 10 1156
轻奢々
轻奢々 2020-12-29 09:16

I have an array like below

$old = array(
       \'a\' => \'blah\',
       \'b\' => \'key\',
       \'c\' => \'amazing\',
       \'d\' => array(
          


        
10条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2020-12-29 09:56

    array_combine(array_merge($old, $keyReplaceInfoz), $old)
    

    I think this looks easier than what you posed.

提交回复
热议问题