【发布时间】:2021-12-19 00:34:16
【问题描述】:
我想用邮政编码值扩展我的城市数组。 如果 city_postcode 数组包含 city 数组名称记录,则将邮政编码值推送 到 city 数组中。这就是我想以某种方式实现的目标。
城市数组:
Array
(
[0] => Array
(
[id] => 1
[city] => Budapest
[population] => 1700000
)
[1] => Array
(
[id] => 2
[city] => Szeged
[population] => 160000
)
)
city_postcode 数组:
Array
(
[0] => Array
(
[name] => Budapest
[post_code] => 12345
)
[1] => Array
(
[name] => Szeged
[post_code] => 33356
)
)
我想要的结果:
Array
(
[0] => Array
(
[id] => 1
[city] => Budapest
[population] => 1700000
[post_code] => 12345
)
[1] => Array
(
[id] => 2
[city] => Szeged
[population] => 160000
[post_code] => 33356
)
)
【问题讨论】:
-
先写一段代码,这里没人会帮你做的。