title: How to get a list of facebook groups for a user using graph api
body: <p>Could someone point me in the right direction to how I can get a list of all the groups a specific user is connected to using the facebook graph api?</p>
  
  <p>I have this:</p>
  
  <pre><code>$groups = $facebook-&gt;api( '/me/groups', 'GET', array( 'access_token=' =&gt; $membertoken ) );
  </code></pre>
  
  <p>If I use <code>print_r($groups)</code> I can see the array is returning all the groups, but how can I seperate the array to list just the group names and group ID into seperate strings so I can use them in a database etc?</p>