LDAP_COUNT_ENTRIES(3) 1 LDAP_COUNT_ENTRIES(3)
ldap_count_entries - Count the number of entries in a search
SYNOPSIS
int ldap_count_entries (resource $link_identifier, resource $result_identifier)
DESCRIPTION
Returns the number of entries stored in the result of previous search operations.
PARAMETERS
o $link_identifier
- An LDAP link identifier, returned by ldap_connect(3).
o $result_identifier
- The internal LDAP result.
RETURN VALUES
Returns number of entries in the result or FALSE on error.
EXAMPLES
Example #1
ldap-count-entries(3) example
Retrieve number of entries in the result.
// $ds is a valid link identifier (see ldap_connect)
$dn = 'ou=example,dc=org';
$filter = '(|(sn=Doe*)(givenname=John*))';
$justthese = array('ou', 'sn', 'givenname', 'mail');
$sr = ldap_search($ds, $dn, $filter, $justthese);
var_dump(ldap_count_entries($ds, $sr));
The above example will output something similar to:
int(1)
PHP Documentation Group LDAP_COUNT_ENTRIES(3)