gpt4 book ai didi

php - 将两个数组转换为关联数组 - PHP

转载 作者:行者123 更新时间:2023-12-02 15:15:48 28 4
gpt4 key购买 nike

<分区>

我需要将一些数组转换为关联数组。我需要将这些值一起保存。

'days1' => 
array (size=5)
0 => string '30' (length=2)
1 => string '90' (length=2)
2 => string '50' (length=2)
3 => string '50' (length=2)
4 => string '5' (length=1)
'price1' =>
array (size=5)
0 => string '5' (length=1)
1 => string '10' (length=2)
2 => string '12' (length=2)
3 => string '13' (length=2)
4 => string '1' (length=1)
'days2' =>
array (size=3)
0 => string '30' (length=2)
1 => string '90' (length=2)
2 => string '180' (length=3)
'price2' =>
array (size=3)
0 => string '6' (length=1)
1 => string '7' (length=1)
2 => string '10' (length=2)

因此 days1 需要与 price1 合并并创建类似这样的东西

array(
30 => 5,
90 =>10,
50 => 12,
50 => 13,
5 => 1
)

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