I am having an issue retrieving the key from this JSON result returned from the last.fm api
this is what is being returned:
{"session":{"name":"mcbeav","key":"***************","subscriber":"1"}}
and i just need the key, but if i try to print_r or var_dump , nothing is displayed how would i go about doing so?
for example if i print_r($json['key']); or if i print_r['session']['key'];
what is printed is “{“;
just use the php function
$myJsonData = json_decode($myJsonString,true)it will give you an assocative array like you have in your code (what the second arguement true is for)
Hope that is what you are looking for