ldap_count_entries

Count the number of entries in a search

&reftitle.description; `int` `ldap_count_entries` `LDAP\Connection` `ldap` `LDAP\Result` `result`

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

&reftitle.parameters;

`ldap`

- &ldap.parameter.ldap;

`result`

- &ldap.parameter.result;

&reftitle.returnvalues;

Returns number of entries in the result,&return.falseforfailure;.

&reftitle.changelog;

&Version; | &Description;
&ldap.changelog.ldap-object; &ldap.changelog.result-object;

&reftitle.examples;

### `ldap_count_entries` example

Retrieve number of entries in the result.

         // $ds is a valid LDAP\Connection instance for a directory server

         $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));

&example.outputs.similar;

         int(1)