<?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-sort.php',
    1 => 'ldap_sort',
    2 => 'Sort LDAP result entries on the client side',
  ),
  'up' => 
  array (
    0 => 'ref.ldap.php',
    1 => 'Функції LDAP',
  ),
  'prev' => 
  array (
    0 => 'function.ldap-set-rebind-proc.php',
    1 => 'ldap_set_rebind_proc',
  ),
  'next' => 
  array (
    0 => 'function.ldap-start-tls.php',
    1 => 'ldap_start_tls',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ldap/functions/ldap-sort.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ldap-sort" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ldap_sort</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">ldap_sort</span> &mdash; <span class="dc-title">Sort LDAP result entries on the client side</span></p>

 </div>

 <div id="function.ldap-sort-refsynopsisdiv">
  <div class="warning"><strong class="warning">Увага</strong><p class="simpara">Ця функція
<em>ЗАСТАРІЛА</em>, починаючи з PHP 7.0.0, та
<em>ВИЛУЧЕНА</em> в PHP 8.0.0. Вкрай не рекомендується на неї
покладатися.</p></div>
 </div>

 <div class="refsect1 description" id="refsect1-function.ldap-sort-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ldap_sort</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$link</code></span>, <span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$result</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$sortfilter</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Sort the result of a LDAP search, returned by
   <span class="function"><a href="function.ldap-search.php" class="function">ldap_search()</a></span>.
  </p>
  <p class="para">
   As this function sorts the returned values on the client side it is possible that 
   you might not get the expected results in case you reach the <code class="parameter">sizelimit</code> either of the server or
   defined within <span class="function"><a href="function.ldap-search.php" class="function">ldap_search()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ldap-sort-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">link</code></dt>
     <dd>
      <p class="para">
       An LDAP resource, returned by <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">
       An search result identifier, returned by
       <span class="function"><a href="function.ldap-search.php" class="function">ldap_search()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">sortfilter</code></dt>
     <dd>
      <p class="para">
       The attribute to use as a key in the sort.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ldap-sort-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Не повертає значень.
  </p>
 </div>


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

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        This function has been removed.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ldap-sort-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   Sorting the result of a search.
   <div class="example" id="example-1">
    <p><strong>Приклад #1 LDAP sort</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 link identifier (see ldap_connect)<br /><br />     </span><span style="color: #0000BB">$dn        </span><span style="color: #007700">= </span><span style="color: #DD0000">'ou=example,dc=org'</span><span style="color: #007700">;<br />     </span><span style="color: #0000BB">$filter    </span><span style="color: #007700">= </span><span style="color: #DD0000">'(|(sn=Doe*)(givenname=John*))'</span><span style="color: #007700">;<br />     </span><span style="color: #0000BB">$justthese </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'ou'</span><span style="color: #007700">, </span><span style="color: #DD0000">'sn'</span><span style="color: #007700">, </span><span style="color: #DD0000">'givenname'</span><span style="color: #007700">, </span><span style="color: #DD0000">'mail'</span><span style="color: #007700">);<br /><br />     </span><span style="color: #0000BB">$sr </span><span style="color: #007700">= </span><span style="color: #0000BB">ldap_search</span><span style="color: #007700">(</span><span style="color: #0000BB">$ds</span><span style="color: #007700">, </span><span style="color: #0000BB">$dn</span><span style="color: #007700">, </span><span style="color: #0000BB">$filter</span><span style="color: #007700">, </span><span style="color: #0000BB">$justthese</span><span style="color: #007700">);<br /><br />     </span><span style="color: #FF8000">// Sort<br />     </span><span style="color: #0000BB">ldap_sort</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">, </span><span style="color: #DD0000">'sn'</span><span style="color: #007700">);<br /><br />     </span><span style="color: #FF8000">// Retrieving the data<br />     </span><span style="color: #0000BB">$info </span><span style="color: #007700">= </span><span style="color: #0000BB">ldap_get_entries</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">);</span></span></code></div>
    </div>

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

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