I’m using this code to get list of friends.
$params = array(
'method' => 'fql.query',
'query' => "SELECT uid FROM user WHERE uid = me()
OR uid IN (SELECT uid2 FROM friend WHERE uid1 = me())",
);
$result = $facebook->api($params);
now i’m displaying the picture of user as
echo "<img src='http://graph.facebook.com/".$result[0]."/picture'>";
but it is still returning the result as an array like this:
http://graph.facebook.com/array/picture
I need the uid at that place where it is showing array. Help please. its really important
print_r ($result[0]); gives the following output—-
Array ( [uid] => XXXXXXXX )
This is 2-D array no need to convert it into object you can still access it
To access uid you have to do something like this
Hence you code will become
If you still want object instead of array you can do type cast.