PHP 7.4.22 Released!

ldap_count_entries

(PHP 4, PHP 5, PHP 7, PHP 8)

ldap_count_entriesCount the number of entries in a search

Açıklama

ldap_count_entries(resource $ldap, resource $result): int

Returns the number of entries stored in the result of previous search operations.

Değiştirgeler

ldap

ldap_connect() işlevinden dönen LDAP özkaynağı.

result

ldap_list() veya ldap_search() işlevinden dönen LDAP sonuç özkaynağı.

Dönen Değerler

Returns number of entries in the result, başarısızlık durumunda false döner.

Örnekler

Örnek 1 ldap_count_entries() 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));

Yukarıdaki örnek şuna benzer bir çıktı üretir:

     int(1)
     

add a note add a note

User Contributed Notes 1 note

up
1
martin dot keckeis1 at gmail dot com
6 years ago
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)
To Top