<?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 => 'en',
  ),
  'this' => 
  array (
    0 => 'collator.create.php',
    1 => 'Collator::create',
    2 => 'Create a collator',
  ),
  'up' => 
  array (
    0 => 'class.collator.php',
    1 => 'Collator',
  ),
  'prev' => 
  array (
    0 => 'collator.construct.php',
    1 => 'Collator::__construct',
  ),
  'next' => 
  array (
    0 => 'collator.getattribute.php',
    1 => 'Collator::getAttribute',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/intl/collator/create.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="collator.create" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Collator::create</h1>
  <h1 class="refname">collator_create</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::create</span> -- <span class="refname">collator_create</span> &mdash; <span class="dc-title">Create a collator</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-collator.create-description">
  <h3 class="title">Description</h3>
  <p class="para">Object-oriented style</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>Collator::create</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>): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.collator.php" class="type Collator">Collator</a></span></span></div>

  <p class="para rdfs-comment">
   Procedural style
  </p>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>collator_create</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>): <span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.collator.php" class="type Collator">Collator</a></span></span></div>

  <p class="para rdfs-comment">
   The strings will be compared using the options already specified.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-collator.create-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">locale</code></dt>
     <dd>
      <p class="para">
       The locale containing the required collation rules. 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 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>
     </dd>
    
   </dl>
  </p>
 </div>



 <div class="refsect1 returnvalues" id="refsect1-collator.create-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Return new instance of <span class="classname"><a href="class.collator.php" class="classname">Collator</a></span> object, or <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>
   on error.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-collator.create-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Example #1 <span class="function"><strong>collator_create()</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">= </span><span style="color: #0000BB">collator_create</span><span style="color: #007700">( </span><span style="color: #DD0000">'en_US' </span><span style="color: #007700">);<br /><br />if( !isset( </span><span style="color: #0000BB">$coll </span><span style="color: #007700">) ) {<br />    </span><span style="color: #0000BB">printf</span><span style="color: #007700">( </span><span style="color: #DD0000">"Collator creation failed: %s\n"</span><span style="color: #007700">, </span><span style="color: #0000BB">intl_get_error_message</span><span style="color: #007700">() );<br />    exit( </span><span style="color: #0000BB">1 </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-collator.create-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="collator.construct.php" class="function" rel="rdfs-seeAlso">Collator::__construct()</a> - Create a collator</span></li>
   </ul>
  </p>
 </div>

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