Getting a list/array of all organic groups a user is part of
Assuming you are using Drupal 7 and latest OG you can use og_get_groups_by_user().


  Get the group IDs of all the groups a user is an approved member of.