<?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 => 'ja',
  ),
  'this' => 
  array (
    0 => 'collator.construct.php',
    1 => 'Collator::__construct',
    2 => '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' => 'ja',
    '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">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">
   新しい <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">
       照合規則を使用するロケール。特殊な場合として、
       空文字列を渡した場合はデフォルトのロケールの照合規則を使用します。
       <code class="literal">&quot;root&quot;</code> を渡した場合は、
       <a href="https://www.unicode.org/reports/tr10/" class="link external">&raquo;&nbsp;UCA</a> の規則を使用します。
      </p>
      <p class="para">
       <code class="parameter">locale</code> 属性は、
       各国・各地域のユーザーの期待通りに並べ替えやマッチングを行うために
       もっとも重要な属性です。デフォルトの
       <a href="https://www.unicode.org/reports/tr10/" class="link external">&raquo;&nbsp;UCA</a>
       の並び順で正しく (&quot;正しく&quot; とは、その言語を使用する人の期待通りにということです)
       処理できるのは、オランダ語やポルトガル語などの一部の言語だけです。
       それ以外の場合は、UCA にロケールを指定して
       その言語に応じた適切な照合を行えるようにする必要があります。
       従って、各ロケールにあわせて正しく設定した collator を使用する必要があります。
       ロケールを選択すると、その他の属性の値も適切な物に自動設定されます。
       従って、その他の属性については明示的に設定する必要はほとんどありません。
       選択したロケールによっては、文字列比較のパフォーマンスやソートキーの長さに違いが出ることがあります。
       
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-collator.construct-errors">
  <h3 class="title">エラー / 例外</h3>
  <p class="para">
   エラー時には &quot;空の&quot; オブジェクトを返します。何が起こったのかを知るには
   <span class="function"><a href="function.intl-get-error-code.php" class="function">intl_get_error_code()</a></span>
   や
   <span class="function"><a href="function.intl-get-error-message.php" class="function">intl_get_error_message()</a></span>
   を使用します。
  </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> の例</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> - collator を作成する</span></li>
    <li><span class="function"><a href="collator.create.php" class="function" rel="rdfs-seeAlso">collator_create()</a> - collator を作成する</span></li>
   </ul>
  </p>
 </div>

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