gpt4 book ai didi

PHP:Array_unshift 不是数字索引

转载 作者:可可西里 更新时间:2023-11-01 13:08:16 25 4
gpt4 key购买 nike

<分区>

只是想用 array_unshift 在我的数组前面添加一个新参数,但是:如果我像往常一样这样做,它有一个数字索引。我怎样才能拒绝索引,例如类似的东西...

<?php
$queue = array("a", "B");
array_unshift($queue, "front" => "hello" ); //Not working, this is my question ;)
?>

数组看起来像

Array {
front => hello
0 => a
1 => B
}

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