简体   繁体   中英

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

i get this json response

    [{"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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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