Hi i want to get the personaname of steam user I have storaged data in files in .json format.
{
"response": {
"players": [
{
"steamid": "76561198137714668",
"communityvisibilitystate": 3,
"profilestate": 1,
"personaname": "UareBugged",
"lastlogoff": 1418911040,
"commentpermission": 1,
"profileurl": "http://steamcommunity.com/id/uarenotbest/",
"avatar": "http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/da/daece8a16d866ef9bd03ddc4aa365c5862af1c21.jpg",
"avatarmedium": "http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/da/daece8a16d866ef9bd03ddc4aa365c5862af1c21_medium.jpg",
"avatarfull": "http://cdn.akamai.steamstatic.com/steamcommunity/public/images/avatars/da/daece8a16d866ef9bd03ddc4aa365c5862af1c21_full.jpg",
"personastate": 1,
"realname": "Michal Šlesár",
"primaryclanid": "103582791436765601",
"timecreated": 1400861961,
"personastateflags": 0,
"loccountrycode": "SK",
"locstatecode": "08"
}
]
}
}
And i want to get the personaname to variable but it doing nothing , variable is empty i think json_decode doesn`t work but i really dont know.
$pname = json_decode(file_get_contents("http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v002/?key=KEYCONSORED&Steamids={$_SESSION['T2SteamID64']}"));
echo $pname['response']['players']['personaname'];
echo is empty
var_dump($pname);
show? – Marta