I'm trying to figure out what I'm doing wrong here, or if this is even formatted improperly all together. I am getting an error on line 3.
foreach($pge['feats'] as $val) {
} if ($val['name'] == 'wins' && $val['value'] == '1')
foreach ($val['value'] == '1' as $count) {
echo count($count);
}
Here's another way I tried...
foreach($pge['feats'] as $val)
if ($val['name'] == 'wins' && $val['value'] == '1')
foreach ($val['value'] == '1' as $count) {
echo count($count);
}
Here's some of the json i'm using. I have several files that will look like this with different values for the wins/value object. My statement will go through each one and check for the wins value to be "1", and then add up the total "1" values together..
Partial contents of my $pge json
{
"playerCount": "2",
"remote": "0",
"feats": [
{
"name": "score",
"value": "32"
},
{
"name": "wins",
"value": "0"
}
]
}
Thank you!