Is there a function to make a copy of a PHP array to another?

前端 未结 19 2256
我寻月下人不归
我寻月下人不归 2020-12-07 06:44

Is there a function to make a copy of a PHP array to another?

I have been burned a few times trying to copy PHP arrays. I want to copy an array defined inside an obj

19条回答
  •  清歌不尽
    2020-12-07 07:18

    $arr_one_copy = array_combine(array_keys($arr_one), $arr_one);

    Just to post one more solution ;)

提交回复
热议问题