<?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-parse-result.php',
    1 => 'ldap_parse_result',
    2 => 'Extrait des informations d\'un r&eacute;sultat',
  ),
  'up' => 
  array (
    0 => 'ref.ldap.php',
    1 => 'Fonctions LDAP',
  ),
  'prev' => 
  array (
    0 => 'function.ldap-parse-reference.php',
    1 => 'ldap_parse_reference',
  ),
  'next' => 
  array (
    0 => 'function.ldap-read.php',
    1 => 'ldap_read',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/ldap/functions/ldap-parse-result.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ldap-parse-result" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ldap_parse_result</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ldap_parse_result</span> &mdash; <span class="dc-title">Extrait des informations d&#039;un résultat</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ldap-parse-result-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ldap_parse_result</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<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>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="class.ldap-result.php" class="type LDAP\Result">LDAP\Result</a></span> <code class="parameter">$result</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter reference">&$error_code</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter reference">&$matched_dn</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter reference">&$error_message</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter reference">&$referrals</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter reference">&$controls</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Analyse un résultat de recherche LDAP.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ldap-parse-result-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">result</code></dt>
     <dd>
      <p class="para">
       Une instance <span class="classname"><a href="class.ldap-result.php" class="classname">LDAP\Result</a></span>, retourné par
 <span class="function"><a href="function.ldap-list.php" class="function">ldap_list()</a></span> ou
 <span class="function"><a href="function.ldap-search.php" class="function">ldap_search()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">error_code</code></dt>
     <dd>
      <p class="para">
       Une référence vers une variable qui sera valorisée du code erreur
       LDAP dans le résultat, ou par <code class="literal">0</code> si aucune erreur
       n&#039;est survenue.
      </p>
     </dd>
    
    
     <dt><code class="parameter">matched_dn</code></dt>
     <dd>
      <p class="para">
       Une référence vers une variable qui sera valorisée du DN correspondant
       s&#039;il a été reconnu dans la requête, sinon, vaudra <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">error_message</code></dt>
     <dd>
      <p class="para">
       Une référence vers une variable qui sera valorisée du message d&#039;erreur LDAP
       dans le résultat, ou d&#039;une chaîne vide si aucune erreur n&#039;est survenue.
      </p>
     </dd>
    
    
     <dt><code class="parameter">referrals</code></dt>
     <dd>
      <p class="para">
       Une référence vers une variable qui sera valorisée d&#039;un jeu de tableaux
       contenant les chaînes de référence dans le résultat, ou un tableau
       vide si aucune référence n&#039;est retournée.
      </p>
     </dd>
    
    
     <dt><code class="parameter">controls</code></dt>
     <dd>
      <p class="para">
       Tableau de <a href="ldap.controls.php" class="link">Contrôles LDAP</a> à envoyer avec la requête.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ldap-parse-result-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.ldap-parse-result-changelog">
  <h3 class="title">Historique</h3>
  <p class="para">
   <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">result</code> attend désormais une instance de
  <span class="classname"><a href="class.ldap-result.php" class="classname">LDAP\Result</a></span> ; auparavant, une <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="literal">ldap result</code> était attendue.
 </td>
</tr>

      <tr>
       <td>7.3.0</td>
       <td>
        Support pour <code class="parameter">controls</code> a été ajouté.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ldap-parse-result-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>ldap_parse_result()</strong></span></strong></p>
    <div class="example-contents">
     <div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$result </span><span style="color: #007700">= </span><span style="color: #0000BB">ldap_search</span><span style="color: #007700">(</span><span style="color: #0000BB">$ldap</span><span style="color: #007700">, </span><span style="color: #DD0000">"cn=userref,dc=my-domain,dc=com"</span><span style="color: #007700">, </span><span style="color: #DD0000">"(cn=user*)"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$errcode </span><span style="color: #007700">= </span><span style="color: #0000BB">$dn </span><span style="color: #007700">= </span><span style="color: #0000BB">$errmsg </span><span style="color: #007700">= </span><span style="color: #0000BB">$refs </span><span style="color: #007700">=  </span><span style="color: #0000BB">null</span><span style="color: #007700">;<br />if (</span><span style="color: #0000BB">ldap_parse_result</span><span style="color: #007700">(</span><span style="color: #0000BB">$ldap</span><span style="color: #007700">, </span><span style="color: #0000BB">$result</span><span style="color: #007700">, </span><span style="color: #0000BB">$errcode</span><span style="color: #007700">, </span><span style="color: #0000BB">$dn</span><span style="color: #007700">, </span><span style="color: #0000BB">$errmsg</span><span style="color: #007700">, </span><span style="color: #0000BB">$refs</span><span style="color: #007700">)) {<br />    </span><span style="color: #FF8000">// faîtes quelques choses avec $errcode, $dn, $errmsg et $refs<br /></span><span style="color: #007700">}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


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