I've been looking all over the interwebz for a simple answer but can't find any. So, the question is:
I'm going to decode some JSON to see if a value exists; though, I don't think I'm doing it right. I want to check if the value of appid: 730 exists.
Here's the JSON:
{
response: {
game_count: 106,
games: [
{
appid: 10,
playtime_forever: 67
},
{
appid: 730,
playtime_forever: 0
},
{
appid: 368900,
playtime_forever: 0
},
{
appid: 370190,
playtime_forever: 0
},
]
}
}
This is what I want:
$json = file_get_contents('JSON URL HERE');
$msgArray = json_decode($json, true);
if (appid: 730 exists) {
...
}
Thanks, hope I explained enough.
$msgArrayin a foreach, and look down the tree forgamesarray.jsonis not responding... Invalid Json