<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.collator.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'collator.construct.php',
    1 => 'Collator::__construct',
    2 => 'Create a collator',
  ),
  'up' => 
  array (
    0 => 'class.collator.php',
    1 => 'Collator',
  ),
  'prev' => 
  array (
    0 => 'collator.compare.php',
    1 => 'Collator::compare',
  ),
  'next' => 
  array (
    0 => 'collator.create.php',
    1 => 'Collator::create',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/intl/collator/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="collator.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Collator::__construct</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8, PECL intl &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Collator::__construct</span> &mdash; <span class="dc-title">Create a collator</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-collator.construct-description">
  <h3 class="title">Опис</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Collator::__construct</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$locale</code></span>)</div>

  <p class="para rdfs-comment">
   Creates a new instance of <span class="classname"><a href="class.collator.php" class="classname">Collator</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-collator.construct-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">locale</code></dt>
     <dd>
      <p class="para">
       The locale whose collation rules should be used. Special values for
       locales can be passed in - if an empty <span class="type"><a href="language.types.string.php" class="type string">string</a></span> is passed for the locale, the
       default locale&#039;s collation rules will be used. If <code class="literal">&quot;root&quot;</code> is passed,
       <a href="https://www.unicode.org/reports/tr10/" class="link external">&raquo;&nbsp;UCA</a> rules will be used.
      </p>
      <p class="para">
       The <code class="parameter">locale</code> attribute is typically the most important attribute for
       correct sorting and matching, according to the user expectations in
       different countries and regions. The default
       <a href="https://www.unicode.org/reports/tr10/" class="link external">&raquo;&nbsp;UCA</a>
       ordering will only sort a few languages such as Dutch and Portuguese
       correctly (&quot;correctly&quot; meaning according to the normal expectations for
       users of the languages). Otherwise, you need to supply the locale to
       UCA in order to properly collate text for a given language. Thus a
       locale needs to be supplied so as to choose a collator that is
       correctly tailored for that locale. The choice of a locale will
       automatically preset the values for all of the attributes to something
       that is reasonable for that locale. Thus most of the time the other
       attributes do not need to be explicitly set. In some cases, the choice
       of locale will make a difference in string comparison performance
       and/or sort key length.
       
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-collator.construct-errors">
  <h3 class="title">Помилки/виключення</h3>
  <p class="para">
   Returns an &quot;empty&quot; object on error. 
   Use <span class="function"><a href="function.intl-get-error-code.php" class="function">intl_get_error_code()</a></span>
   and/or <span class="function"><a href="function.intl-get-error-message.php" class="function">intl_get_error_message()</a></span>
   to know what happened.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-collator.construct-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 <span class="function"><strong>Collator::__construct()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$coll </span><span style="color: #007700">= new </span><span style="color: #0000BB">Collator</span><span style="color: #007700">(</span><span style="color: #DD0000">'en_CA'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


 <div class="refsect1 seealso" id="refsect1-collator.construct-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="collator.create.php" class="function" rel="rdfs-seeAlso">Collator::create()</a> - Create a collator</span></li>
    <li><span class="function"><a href="collator.create.php" class="function" rel="rdfs-seeAlso">collator_create()</a> - Create a collator</span></li>
   </ul>
  </p>
 </div>

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