$stat_url = 'http://api.steampowered.com/ISteamUserStats/GetUserStatsForGame/v0002/?appid=730&key=ECFB8FBC534B61C454899F4D7E99BB71&steamid=76561198129638121';
$stat_json = file_get_contents($stat_url);
$stat_decoded = json_decode($stat_json, true);
I have only been able to target the value by number, but the api doesnt always return it in the same order. So I want to be able to target the name (EX: total_kills) and then get the value (85990).
print_r($stat_decoded['playerstats']['stats']);
Array (
[
0
] => Array ( [
name
] => total_kills [
value
] => 85990 ) [
1
] => Array ( [
name
] => total_deaths [
value
] => 88675 ) [
2
] => Array ( [
name
] => total_time_played [
value
] => 7051848 ) [
3
] => Array ( [
name
] => total_planted_bombs [
value
] => 2131 ) [
4
] => Array ( [
name
] => total_defused_bombs [
value
] => 1234 ) [
5
] => Array ( [
name
] => total_wins [
value
] => 47204 )
Don't worry about the API key, it will be reset.