嗨,我有两个不均匀的 JSON 数组,我在 php 中解码。第一个数组有 2 个值,其他有 3 个值现在我想从第一个数组到第二个数组搜索一个“id”号并显示名称。有什么办法吗?我会很感激你的帮助。谢谢
这是我的第一个数组的示例
[
{
"id": 5,
"pb_first_name": "Respect",
"pb_last_name": "Respect"
},
{
"id": 41,
"pb_first_name": "Master",
"pb_last_name": "Master"
}
]
这是第二个 JSON 数组
[
{
"id": 5,
"type": "Suite",
"description": "",
"number": "105",
"floor": 1
},
{
"id": 23,
"type": "Suite",
"description": "",
"number": "220",
"floor": 2
},
{
"id": 41,
"type": "Penthouse",
"description": "",
"number": "410",
"floor": 4
}
]