I successfully loaded the friends array containing more arrays into a variable. But how do I iterate through it to take only the id’s out?
I used:
$friends = $facebook->api('/me/friends/');
It returns a multidimensional array like so:
array(1) { ["name"] => "Username" ["id"] => "User ID #"}
array(2) { ["name"] => "Username" ["id"] => "User ID #"}
...and so on...
Any help would be appreciated! Thanks.
Results of Graph API almost always contain
dataproperty which is contain all the response data, to get only the friends ids you can look over it in such way: