【发布时间】:2021-03-31 19:37:12
【问题描述】:
我想更改数组 [0]、[1] 等中的数字 老实说,我也不知道他们的名字,但我在他们之后做了箭头
Array
(
[user_id] => 1
[0] => Array # <----- this [0]
(
[prod] =>
)
[1] => Array # <----- this [1]
(
[item] => 1
[place] => 2
[holder] => 2
[type] => 1
[amount] => 1
[sellprice] => 13000.00
[buyprice] => 12000.00
[notification] => 16
)
)
想要的结果:
Array
(
[user_id] => 1
['Some Title'] => Array # <----- this [0]
(
[prod] =>
)
['Title'] => Array # <----- this [1]
(
[item] => 1
[place] => 2
[holder] => 2
[type] => 1
[amount] => 1
[sellprice] => 13000.00
[buyprice] => 12000.00
[notification] => 16
)
)
我想用一些标题替换那些 [0] 和 [1]
这个代码是用 array_push 生成的
【问题讨论】:
-
您能发布您希望输出的样子吗?
-
嗨,欢迎来到 SO,你看过 PHP 文档了吗?php.net/manual/en/function.array-map.php
-
@bassxzero 检查编辑