<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.imap.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.imap-sort.php',
    1 => 'imap_sort',
    2 => 'Gets and sort messages',
  ),
  'up' => 
  array (
    0 => 'ref.imap.php',
    1 => 'IMAP Функції',
  ),
  'prev' => 
  array (
    0 => 'function.imap-setflag-full.php',
    1 => 'imap_setflag_full',
  ),
  'next' => 
  array (
    0 => 'function.imap-status.php',
    1 => 'imap_status',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/imap/functions/imap-sort.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imap-sort" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imap_sort</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imap_sort</span> &mdash; <span class="dc-title">Gets and sort messages</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.imap-sort-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imap_sort</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="class.imap-connection.php" class="type IMAP\Connection">IMAP\Connection</a></span> <code class="parameter">$imap</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">$criteria</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$reverse</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">$flags</code><span class="initializer"> = 0</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$search_criteria</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"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$charset</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span><br>): <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">
   Gets and sorts message numbers by the given parameters.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-function.imap-sort-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    <dt>
<code class="parameter">imap</code></dt><dd><p class="para">Примірник
<span class="classname"><a href="class.imap-connection.php" class="classname">IMAP\Connection</a></span>.</p></dd>
    
     <dt><code class="parameter">criteria</code></dt>
     <dd>
      <p class="para">
       Criteria can be one (and only one) of the following:
       <ul class="itemizedlist">
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.sortdate">SORTDATE</a></code></strong> - message Date
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.sortarrival">SORTARRIVAL</a></code></strong> - arrival date
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.sortfrom">SORTFROM</a></code></strong> - mailbox in first From address
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.sortsubject">SORTSUBJECT</a></code></strong> - message subject
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.sortto">SORTTO</a></code></strong> - mailbox in first To address
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.sortcc">SORTCC</a></code></strong> - mailbox in first cc address
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.sortsize">SORTSIZE</a></code></strong> - size of message in octets
         </span>
        </li>
       </ul>
      </p>
     </dd>
    
    
     <dt><code class="parameter">reverse</code></dt>
     <dd>
      <p class="para">
       Whether to sort in reverse order.
      </p>
     </dd>
    
    
     <dt><code class="parameter">flags</code></dt>
     <dd>
      <p class="para">
       The <code class="parameter">flags</code> are a bitmask of one or more of the
       following:
       <ul class="itemizedlist">
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.se-uid">SE_UID</a></code></strong> - Return UIDs instead of sequence numbers
         </span>
        </li>
        <li class="listitem">
         <span class="simpara">
          <strong><code><a href="imap.constants.php#constant.se-noprefetch">SE_NOPREFETCH</a></code></strong> - Don&#039;t prefetch searched messages
         </span>
        </li>
       </ul>
      </p>
     </dd>
    
    
     <dt><code class="parameter">search_criteria</code></dt>
     <dd>
      <p class="para">
       IMAP2-format search criteria string. For details see
       <span class="function"><a href="function.imap-search.php" class="function">imap_search()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">charset</code></dt>
     <dd>
      <p class="para">
       MIME character set to use when sorting strings.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.imap-sort-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns an array of message numbers sorted by the given
   parameters,  або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imap-sort-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">imap</code> має бути примірником
  <span class="classname"><a href="class.imap-connection.php" class="classname">IMAP\Connection</a></span>; раніше очікувався дійсний <a href="language.types.resource.php" class="link">resource</a>
  <code class="literal">imap</code>.
 </td>
</tr>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">reverse</code> is now <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> instead of <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>.
      </td>
     </tr>

     <tr>
      <td>8.0.0</td>
      <td>
       <code class="parameter">search_criteria</code> and <code class="parameter">charset</code> are now <span class="type">nullable</span>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>

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