<?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 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.ldap-get-values.php',
    1 => 'ldap_get_values',
    2 => 'Get all values from a result entry',
  ),
  'up' => 
  array (
    0 => 'ref.ldap.php',
    1 => 'Функції LDAP',
  ),
  'prev' => 
  array (
    0 => 'function.ldap-get-option.php',
    1 => 'ldap_get_option',
  ),
  'next' => 
  array (
    0 => 'function.ldap-get-values-len.php',
    1 => 'ldap_get_values_len',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ldap/functions/ldap-get-values.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ldap-get-values" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ldap_get_values</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ldap_get_values</span> &mdash; <span class="dc-title">Get all values from a result entry</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ldap-get-values-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ldap_get_values</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="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$attribute</code></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Reads all the values of the attribute in the entry in the result.
  </p>
  <p class="para">
   This call needs a <code class="parameter">entry</code>,
   so needs to be preceded by one of the ldap search calls and one
   of the calls to get an individual entry.
  </p>
  <p class="para">
   You application will either be hard coded to look for certain
   attributes (such as &quot;surname&quot; or &quot;mail&quot;) or you will have to use
   the <span class="function"><a href="function.ldap-get-attributes.php" class="function">ldap_get_attributes()</a></span> call to work out
   what attributes exist for a given entry.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ldap-get-values-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">ldap</code></dt>
     <dd>
      <p class="para">
       Примірник <span class="classname"><a href="class.ldap-connection.php" class="classname">LDAP\Connection</a></span>, якого
повертає <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">
       Примірник <span class="classname"><a href="class.ldap-result-entry.php" class="classname">LDAP\ResultEntry</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">attribute</code></dt>
     <dd>
      <p class="para">
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ldap-get-values-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns an array of values for the attribute on success and <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on
   error. The number of values can be found by indexing &quot;count&quot; in the
   resultant array. Individual values are accessed by integer index in the
   array.  The first index is 0.
  </p>
  <p class="para">
   LDAP allows more than one entry for an attribute, so it can, for example,
   store a number of email addresses for one person&#039;s directory entry all
   labeled with the attribute &quot;mail&quot;
   <div class="informalexample">
    <pre class="literallayout">
    return_value[&quot;count&quot;] = number of values for attribute
    return_value[0] = first value of attribute
    return_value[i] = ith value of attribute
    </pre>
   </div>
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.ldap-get-values-changelog">
  <h3 class="title">Журнал змін</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Версія</th>
      <th>Опис</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  Тепер параметр <code class="parameter">ldap</code> має бути примірником
  <span class="classname"><a href="class.ldap-connection.php" class="classname">LDAP\Connection</a></span>; раніше очікувався дійсний <a href="language.types.resource.php" class="link">resource</a>
  <code class="literal">ldap link</code>.
 </td>
</tr>

     <tr>
 <td>8.1.0</td>
 <td>
  Тепер параметр <code class="parameter">entry</code> має бути примірником
  <span class="classname"><a href="class.ldap-result-entry.php" class="classname">LDAP\ResultEntry</a></span>; раніше очікувався дійсний
  <a href="language.types.resource.php" class="link">resource</a> <code class="literal">ldap result entry</code>.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.ldap-get-values-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 List all values of the &quot;mail&quot; attribute for a directory entry</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 is a valid LDAP\Connection instance for a directory server<br /><br />// $sr is a valid search result from a prior call to<br />//     one of the ldap directory search calls<br /><br />// $entry is a valid entry identifier from a prior call to<br />//        one of the calls that returns a directory entry<br /><br /></span><span style="color: #0000BB">$values </span><span style="color: #007700">= </span><span style="color: #0000BB">ldap_get_values</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">, </span><span style="color: #DD0000">"mail"</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #0000BB">$values</span><span style="color: #007700">[</span><span style="color: #DD0000">"count"</span><span style="color: #007700">] . </span><span style="color: #DD0000">" email addresses for this entry.&lt;br /&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">$values</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">$values</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-values-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.ldap-get-values-len.php" class="function" rel="rdfs-seeAlso">ldap_get_values_len()</a> - Get all binary values from a result entry</span></li>
   </ul>
  </p>
 </div>


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