<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ldap.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.ldap-first-attribute.php',
    1 => 'ldap_first_attribute',
    2 => 'Return first attribute',
  ),
  'up' => 
  array (
    0 => 'ref.ldap.php',
    1 => 'LDAP Functions',
  ),
  'prev' => 
  array (
    0 => 'function.ldap-explode-dn.php',
    1 => 'ldap_explode_dn',
  ),
  'next' => 
  array (
    0 => 'function.ldap-first-entry.php',
    1 => 'ldap_first_entry',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ldap/functions/ldap-first-attribute.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ldap-first-attribute" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ldap_first_attribute</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ldap_first_attribute</span> &mdash; <span class="dc-title">Return first attribute</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ldap-first-attribute-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ldap_first_attribute</strong></span>(<span class="methodparam"><span class="type"><a href="class.ldap-connection.php" class="type LDAP\Connection">LDAP\Connection</a></span> <code class="parameter">$ldap</code></span>, <span class="methodparam"><span class="type">LDAP\ResultEntry</span> <code class="parameter">$entry</code></span>): <span class="type"><span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Gets the first attribute in the given entry. Remaining attributes are
   retrieved by calling <span class="function"><a href="function.ldap-next-attribute.php" class="function">ldap_next_attribute()</a></span> successively.
  </p>
  <p class="para">
   Similar to reading entries, attributes are also read one by one from a
   particular entry.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ldap-first-attribute-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">ldap</code></dt>
     <dd>
      <p class="para">
       An <span class="classname"><a href="class.ldap-connection.php" class="classname">LDAP\Connection</a></span> instance, returned by <span class="function"><a href="function.ldap-connect.php" class="function">ldap_connect()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">entry</code></dt>
     <dd>
      <p class="para">
       An <span class="classname"><a href="class.ldap-result-entry.php" class="classname">LDAP\ResultEntry</a></span> instance.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ldap-first-attribute-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the first attribute in the entry on success and <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on
   error.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.ldap-first-attribute-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  The <code class="parameter">ldap</code> parameter expects an <span class="classname"><a href="class.ldap-connection.php" class="classname">LDAP\Connection</a></span>
  instance now; previously, a valid <code class="literal">ldap link</code> <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
 </td>
</tr>

     <tr>
 <td>8.1.0</td>
 <td>
  The <code class="parameter">entry</code> parameter expects an <span class="classname"><a href="class.ldap-result-entry.php" class="classname">LDAP\ResultEntry</a></span>
  instance now; previously, a valid <code class="literal">ldap result entry</code> <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> was expected.
 </td>
</tr>

     <tr>
      <td>8.0.0</td>
      <td>
       The unused third parameter <code class="parameter">ber_identifier</code> is no longer accepted.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.ldap-first-attribute-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.ldap-next-attribute.php" class="function" rel="rdfs-seeAlso">ldap_next_attribute()</a> - Get the next attribute in result</span></li>
    <li><span class="function"><a href="function.ldap-get-attributes.php" class="function" rel="rdfs-seeAlso">ldap_get_attributes()</a> - Get attributes from a search result entry</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>