The ldap_entry_count() function returns the number of entries that exist in a specific LDAP message. The ldap_search() function generates LDAPEntry.

result = ldap_entry_count (LDAPEntry);
LDAPEntry Required. LDAP message that is generated by ldap_search().
integer The number of entries that are contained in the specified LDAP message.
0 If zero entries or on error.
result = ldap_entry_count (LDAPEntry);

In this example, result contains the number of entries in the LDAP message that is identified by LDAPEntry.

For more information, please see ldap_search.