⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 collator.construct.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Create a collator</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="collator.compare.html">Collator::compare</a></div> <div class="next" style="text-align: right; float: right;"><a href="collator.create.html">Collator::create</a></div> <div class="up"><a href="class.collator.html">Collator</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="collator.construct" class="refentry"> <div class="refnamediv">  <h1 class="refname">Collator::__construct</h1>  <p class="verinfo">(No version information available, might be only in CVS)</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">  <h3 class="title">Description</h3>  <div class="constructorsynopsis dc-description">    <span class="methodname"><b><b>Collator::__construct</b></b></span>    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$locale</tt></span>   )</div>  <p class="para rdfs-comment">   Creates a new instance of Collator.  </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">locale</tt></i></span>     <dd>      <p class="para">       The locale whose collation rules should be used. Special values for       locales can be passed in - if null is passed for the locale, the       default locale collation rules will be used. If empty string (&quot;&quot;) or       &quot;root&quot; are passed, UCA rules will be used.      </p>      <p class="para">       The Locale 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="http://www.unicode.org/reports/tr10/" class="link external">&raquo; 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>    </dt>   </dl>  </p> </div> <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   Returns Collator instance.  </p> </div> <div class="refsect1 errors">  <h3 class="title">Errors/Exceptions</h3>  <p class="para">   Returns an &quot;empty&quot; object on error. You can use   <a href="function.intl-get-error-code.html" class="function">intl_get_error_code()</a>   and/or   <a href="function.intl-get-error-message.html" class="function">intl_get_error_message()</a>   to know what happened.  </p> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #1 <b>Collator::__construct()</b> example</b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$coll&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">Collator</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">'en_CA'&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>   </div>  </p> </div> <div class="refsect1 seealso">  <h3 class="title">See Also</h3>  <p class="para">   <ul class="simplelist">    <li class="member"><a href="collator.create.html" class="function" rel="rdfs-seeAlso">Collator::create()</a></li>    <li class="member"><a href="collator.create.html" class="function" rel="rdfs-seeAlso">collator_create()</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="collator.compare.html">Collator::compare</a></div> <div class="next" style="text-align: right; float: right;"><a href="collator.create.html">Collator::create</a></div> <div class="up"><a href="class.collator.html">Collator</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -