php - 如果有很多相同的 value,我如何捕获一个 json value

我得到这个 json 响应

[{"app_id":"com.mojang.minecraftpe","description":"Millions of crafters have smashed billions of blocks! Now you can join the fun!","developer":"Mojang","developer_id":"4772240228547998649",
"free":false,"full_price":null,"icon":".....","price":"$7.49","score":null,"title":"Minecraft","url":"/store/apps/details?id=com.mojang.minecraftpe"},{"app_id":"com.mojang.minecraftedu","description":"Game-based learning using creativity, collaboration, and problem-solving.","developer":"Mojang",
"developer_id":"4772240228547998649","free":true,"full_price":"0","icon":"......","price":"0","score":null,"title":"Minecraft: Education Edition","url":"/store/apps/details?id=com.mojang.minecraftedu"},{"app_id":"com.appblockgames.freecraftexploration","description":"MCPE Master Game Minecraft: Mods, Maps, Servers, Skins, Addons, Textures.","developer":"Master for Minecraft","developer_id":"5713672414955811747"
,"free":true,"full_price":"0","icon":"......","price":"0","score":null,"title":"MOD-MASTER for Minecraft PE","url":"/store/apps/details?id=com.appblockgames.freecraftexploration"}

我想捕获 app_id 的第一个结果,我该怎么做?

回答1

$json = '<your_json_response_here>';
$array = json_decode($json, true);
$app_id = $array[0]['app_id'];

相似文章

随机推荐

最新文章