<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="function.ldap-count-entries" xmlns="http://docbook.org/ns/docbook">
 <refnamediv>
  <refname>ldap_count_entries</refname>
  <refpurpose>Count the number of entries in a search</refpurpose>
 </refnamediv>
 
 <refsect1 role="description">
  &reftitle.description;
  <methodsynopsis>
   <type>int</type><methodname>ldap_count_entries</methodname>
   <methodparam><type>LDAP\Connection</type><parameter>ldap</parameter></methodparam>
   <methodparam><type>LDAP\Result</type><parameter>result</parameter></methodparam>
  </methodsynopsis>
  <para>
   Returns the number of entries stored in the result of previous search
   operations.
  </para>
 </refsect1>

 <refsect1 role="parameters">
  &reftitle.parameters;
  <para>
   <variablelist>
    <varlistentry>
     <term><parameter>ldap</parameter></term>
     <listitem>
      <para>
       &ldap.parameter.ldap;
      </para>
     </listitem>
    </varlistentry>
    <varlistentry>
     <term><parameter>result</parameter></term>
     <listitem>
      <para>
       &ldap.parameter.result;
      </para>
     </listitem>
    </varlistentry>
   </variablelist>
  </para>
 </refsect1>

 <refsect1 role="returnvalues">
  &reftitle.returnvalues;
  <para>
   Returns number of entries in the result,&return.falseforfailure;.
  </para>
 </refsect1>

 <refsect1 role="changelog">
  &reftitle.changelog;
  <informaltable>
   <tgroup cols="2">
    <thead>
     <row>
      <entry>&Version;</entry>
      <entry>&Description;</entry>
     </row>
    </thead>
    <tbody>
     &ldap.changelog.ldap-object;
     &ldap.changelog.result-object;
    </tbody>
   </tgroup>
  </informaltable>
 </refsect1>

 <refsect1 role="examples">
  &reftitle.examples;
  <para>
   <example xml:id="ldap-count-entries.example.basic">
    <title><function>ldap_count_entries</function> example</title>
    <para>
     Retrieve number of entries in the result.
    </para>
    <programlisting role="php">
     <![CDATA[
     // $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));
     ]]>
    </programlisting>
    &example.outputs.similar;
    <screen>
     <![CDATA[
     int(1)
     ]]>
    </screen>
   </example>
  </para>
 </refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
