title: list groups from user with ldap
body: <p>I'm really new to LDAP and just got a connection between my php server and my ad server. I've succefully been able to authenticate users. Now I want to list all groups the users are in to see if he's an admin or not (or there might be another way?).</p>
  
  <p>I have this so far:</p>
  
  <pre><code>    $ldap = ldap_connect("192.168.1.108");
      if ($ldap &amp;&amp; $bind = @ldap_bind($ldap, $name."@foobar.com", $pw)) {
          // ldap_search and ldap_get_entries here i guess, but how?
      }
  </code></pre>
  
  <p>I've tried with ldap_search by reading the manual at php.net but I couldn't get it to work at all. Can somebody show me how to get it to work?</p>