If your search result is larger then the directory limit, it will just show you the maximum number of return entries possible by the directory (.e.g 2000 in some ActiveDirectories)
(PHP 4, PHP 5, PHP 7, PHP 8)
ldap_count_entries — Посчитать число записей в результатах поиска
$ldap
, resource $result
): intВозвращает число записей, сохранённых в результате предыдущей операции поиска.
ldap
Идентификатор ссылки LDAP, возвращённый функцией ldap_connect().
result
Внутренний результат LDAP.
Возвращает число записей в результате или false
в случае ошибки.
Пример #1 Пример использования функции ldap-count-entries()
Получение числа записей в результате.
// $ds - действительный идентификатор соединения (смотрите 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));
Результатом выполнения данного примера будет что-то подобное:
int(1)
If your search result is larger then the directory limit, it will just show you the maximum number of return entries possible by the directory (.e.g 2000 in some ActiveDirectories)