Im trying to return the friend list of a user using a Facebook app without using the PHP SDK. I have managed to return the users name, gender, etc. without using an auth code. Im now trying to return a list of names who are the users friends, all ive managed to do so far is print the array, I cant seem to only print the name as its laid out differently to the users name, gender, etc. which I managed to echo by doing:
$user->name
But when I try that for the friends list it doesnt work and doesnt echo anything at all, I was just wondering if anyone knew how I go about doing this?
Using print_r I get the following:
Array(
[0] => Array ( [name] => Friend's name [id] => x )
[1] => Array ( [name] => Friend's name [id] => x )
[2] =>....)
Until all of the friends have been listed.
{ "name": "Name",
"hometown": {
"id": "Hometown_id",
"name": "Hometown"
},
"id": "Friend_id" }
Above is the structure of the array of each, I think a potential issue is that not everybody has a hometown set which may be why I'm receiving a forEach error?