gpt4 book ai didi

php - 将数组中的值添加到数组?

转载 作者:可可西里 更新时间:2023-10-31 22:49:44 24 4
gpt4 key购买 nike

我如何将数组中的值添加到数组中,以便它随时间增长。

例如。

all values form array1 to myArray.

all values form array2 to myArray.

所以现在 myArray 包含 1 和 2 的所有值。

我想以 cpu 高效的方式来做这件事

最佳答案

$myArray = array_merge($array1, $array2);

参见 documentation ,因为关于如何处理重复键和数字键,您会想知道一些事情。

关于php - 将数组中的值添加到数组?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2226651/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com