$results = ldap_search($ldapconn, $dn, "sn=G*", array(telephoneNumber, userPrincipalName, mail)); $entry = ldap_first_entry($ldapconn, $results); $attr = ldap_first_attribute($ldapconn, $entry, $ber); while ($attr = ldap_next_attribute($ldapconn, $entry, &$ber)) echo $attr."
";