gpt4 book ai didi

php - 推送到数组的特定位置

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:52:19 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Insert into array at a specified place

如何将 1 个或多个值推送到数组的中间(或特定位置/索引)?例如:

$a = array('a', 'b', 'e', 'f');
array_pushTo($a, 1, 'c', 'd'); // that function i'm looking for. first parameter is the array, second is the index, and third and other are the values.
// $a now is: array('a', 'b', 'c', 'd', 'e', 'f');

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