I need to retrieve information about a set of groups, based on either a list of users or group IDs.
$groups = $facebook->api_client->groups_get();
If you specify no filters, you’ll get all the groups for the
loggedinuser. You can
specify a different user’s
filter for them:
$groups = $facebook->api_client->groups_get(12345);
In that case, you’ll get something back only if the current
loggedinuser is allowed to see the
groups for the user you’ve specified. If you have one or more
gids (group IDs) and just want to pull
information on them, you can do that too:
$targetGroups = array('2248774311', '14740918186'); $groups = $facebook->api_client->groups_get(null, $targetGroups);
Groups.get() returns a multidimensional array of group records, with
each element containing the fields listed in Groups Table.
If you’d prefer to use FQL to access groups, the equivalent query is:
SELECT gid, name, description FROM group WHERE gid IN (SELECT gid FROM group_member WHERE uid=$uid) AND gid IN ($gids)
See Groups Table for more information.