<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.ldap-get-attributes.php',
    1 => 'ldap_get_attributes',
    2 => 'Lit les attributs d\'une entr&eacute;e',
  ),
  'up' => 
  array (
    0 => 'ref.ldap.php',
    1 => 'Fonctions LDAP',
  ),
  'prev' => 
  array (
    0 => 'function.ldap-free-result.php',
    1 => 'ldap_free_result',
  ),
  'next' => 
  array (
    0 => 'function.ldap-get-dn.php',
    1 => 'ldap_get_dn',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/ldap/functions/ldap-get-attributes.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ldap-get-attributes" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ldap_get_attributes</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ldap_get_attributes</span> &mdash; <span class="dc-title">Lit les attributs d&#039;une entrée</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ldap-get-attributes-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ldap_get_attributes</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"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   Lit les attributs et les valeurs pour une entrée d&#039;un résultat de recherche.
  </p>
  <p class="para">
   Une fois qu&#039;on a repéré une entrée dans un dossier, l&#039;on peut
   obtenir plus d&#039;informations sur elle avec cette fonction. Elle pourrait être
   utilisée dans le cadre d&#039;une application qui cartographie les dossiers et les
   entrées. Dans de nombreuses applications, on recherche des entrées
   ayant un attribut précis, sans se soucier des autres attributs.
   <div class="informalexample">
    <div class="example-contents">
<div class="cdata"><pre>
return_value[&quot;count&quot;] = nombre d&#039;attributs dans l&#039;entrée
return_value[0] = premier attribut
return_value[n] = n-ième attribut

return_value[&quot;attribute&quot;][&quot;count&quot;] = nombre de valeurs de l&#039;attribut
return_value[&quot;attribute&quot;][0] = première valeur de l&#039;attribut
return_value[&quot;attribute&quot;][i] = (i+1)-ème valeur de l&#039;attribut
</pre></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ldap-get-attributes-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">ldap</code></dt>
     <dd>
      <p class="para">
       Une instance <span class="classname"><a href="class.ldap-connection.php" class="classname">LDAP\Connection</a></span>, retourné par
 <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">
       Une instance <span class="classname"><a href="class.ldap-result-entry.php" class="classname">LDAP\ResultEntry</a></span>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ldap-get-attributes-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne le détail des informations d&#039;une entrée sous la
   forme d&#039;un tableau multidimensionnel.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.ldap-get-attributes-changelog">
  <h3 class="title">Historique</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>
  Le paramètre <code class="parameter">ldap</code> attend désormais une instance de
  <span class="classname"><a href="class.ldap-connection.php" class="classname">LDAP\Connection</a></span> ; auparavant, une <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="literal">ldap link</code> était attendue.
 </td>
</tr>

     <tr>
 <td>8.1.0</td>
 <td>
  Le paramètre <code class="parameter">entry</code> attend désormais une instance de
  <span class="classname"><a href="class.ldap-result-entry.php" class="classname">LDAP\ResultEntry</a></span> ; auparavant, une <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="literal">ldap result entry</code> était attendue.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.ldap-get-attributes-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Affiche la liste des attributs d&#039;une entrée</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// $ds doit être une instance de connexion LDAP\Connection valide<br /><br />// $sr est une recherche valide, issue d'une opération<br />// précédente<br /><br /></span><span style="color: #0000BB">$entry </span><span style="color: #007700">= </span><span style="color: #0000BB">ldap_first_entry</span><span style="color: #007700">(</span><span style="color: #0000BB">$ds</span><span style="color: #007700">, </span><span style="color: #0000BB">$sr</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$attrs </span><span style="color: #007700">= </span><span style="color: #0000BB">ldap_get_attributes</span><span style="color: #007700">(</span><span style="color: #0000BB">$ds</span><span style="color: #007700">, </span><span style="color: #0000BB">$entry</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">$attrs</span><span style="color: #007700">[</span><span style="color: #DD0000">"count"</span><span style="color: #007700">] . </span><span style="color: #DD0000">" attributs dans cette entrée :&lt;p&gt;"</span><span style="color: #007700">;<br /><br />for (</span><span style="color: #0000BB">$i</span><span style="color: #007700">=</span><span style="color: #0000BB">0</span><span style="color: #007700">; </span><span style="color: #0000BB">$i </span><span style="color: #007700">&lt; </span><span style="color: #0000BB">$attrs</span><span style="color: #007700">[</span><span style="color: #DD0000">"count"</span><span style="color: #007700">]; </span><span style="color: #0000BB">$i</span><span style="color: #007700">++) {<br />    echo </span><span style="color: #0000BB">$attrs</span><span style="color: #007700">[</span><span style="color: #0000BB">$i</span><span style="color: #007700">] . </span><span style="color: #DD0000">"&lt;br /&gt;"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ldap-get-attributes-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.ldap-first-attribute.php" class="function" rel="rdfs-seeAlso">ldap_first_attribute()</a> - Retourne le premier attribut</span></li>
    <li><span class="function"><a href="function.ldap-next-attribute.php" class="function" rel="rdfs-seeAlso">ldap_next_attribute()</a> - Lit l'attribut suivant</span></li>
   </ul>
  </p>
 </div>


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