<?php
$json = ' {
"response": {
"success": true,
"groups": [
{
"gid": "4458711"
},
{
"gid": "9538146"
},
{
"gid": "11683421"
},
{
"gid": "24781197"
},
{
"gid": "25160263"
},
{
"gid": "26301716"
},
{
"gid": "29202157"
},
{
"gid": "1111111"
}
]
}
}';
$groupid = "1111111";
//$url = "https://api.steampowered.com/ISteamUser/GetUserGroupList/v1/?key=APIKEYHERE&steamid=STEAMID64HERE";
// $result = file_get_contents($url);
// Will dump a beauty json :)
$pretty = json_decode($json);
$s = $pretty->response->groups;
foreach($s as $value)
{
echo $value->gid;
if((int) $groupid == $value->gid)
{
echo "Found";
echo "<br></br>";
}else
{
echo "Not found";
echo "<br></br>";
}
}
?>