September 2001
Intermediate to advanced
768 pages
32h 45m
English
int ldap_count_entries(resource connectionID, int result)
Counts returned entries.
Returns:
Number of entries; FALSE on error
Description:
Returns the number of entries found from performing a query with a search function such as ldap_read() or ldap_search(). Useful for looping through a result set.
Availability:
UNIX/Linux, Windows
Version:
3+, 4+
Example:
$host = "ldap.foo.com"; $ldapconn = ldap_connect($host); $filter = "smith"; $result = ldap_search($ldapconn, "ou=People,dc=foo,dc=com", "cn=*$filter*"); $count = ldap_count_entries($ldapconn,$result); echo "Found $count entries matching $filter in the directory\n"; |
Read now
Unlock full access