简体   繁体   English

如果有很多相同的值,我如何捕获 json 值

[英]how i can capture a json value if have a lot of the same value

i get this json response我得到这个 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"}

i want capture the first result of app_id, how i can?我想捕获 app_id 的第一个结果,我该怎么做?

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM