I have a web page written in php where i get some info about the user from his linked in profile, thanks to linked in API. It gives me the following json object. with :
$user = json_decode($response);
method i decode the following json object into $user object.
{ "firstName": "Tolga", "lastName": "Evcimen", "skills": { "_total": 2, "values": [ { "id": 1, "skill": {"name": "Microsoft Office"} }, { "id": 2, "skill": {"name": "Microsoft Excel"} } ] } }
what i can't is to work with these values, my php knowledge is a little low, that's why i don't know how to read skills or anything else. The only thing I could read so far is :
$user->firstName , $user->lastName
but I can't get the rest with same approach :(
$user->skills->values[1]->skill->name, or $user->skills->_total
please give me some information about these things
var_dump($user)will let you see the actual structure of what you get by json_decode. Then it will be trivial.$userdo aprint_rorvar_dumpto see the structurestdClass, not arrays. php.net/manual/en/function.json-decode.php