<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.strings.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.strcoll.php',
    1 => 'strcoll',
    2 => '基于区域设置的字符串比较',
  ),
  'up' => 
  array (
    0 => 'ref.strings.php',
    1 => '字符串 函数',
  ),
  'prev' => 
  array (
    0 => 'function.strcmp.php',
    1 => 'strcmp',
  ),
  'next' => 
  array (
    0 => 'function.strcspn.php',
    1 => 'strcspn',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'reference/strings/functions/strcoll.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.strcoll" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">strcoll</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">strcoll</span> &mdash; <span class="dc-title">基于区域设置的字符串比较</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.strcoll-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>strcoll</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string1</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$string2</code></span>): <span class="type"><a href="language.types.integer.php" class="type int">int</a></span></div>

  <p class="para rdfs-comment">
   注意该比较区分大小写。和 <span class="function"><a href="function.strcmp.php" class="function">strcmp()</a></span> 不同，该函数不是二进制安全的。
  </p>
  <p class="para">
   <span class="function"><strong>strcoll()</strong></span> 使用当前区域设置进行比较。如果当前区域为 C 或 POSIX，该函数等同于 <span class="function"><a href="function.strcmp.php" class="function">strcmp()</a></span>。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.strcoll-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">string1</code></dt>
     <dd>
      <p class="para">
       第一个字符串。
      </p>
     </dd>
    
    
     <dt><code class="parameter">string2</code></dt>
     <dd>
      <p class="para">
       第二个字符串。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.strcoll-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
     如果 <code class="parameter">string1</code> 小于
   <code class="parameter">string2</code> 返回 &lt; 0；
   如果 <code class="parameter">string1</code>
   大于 <code class="parameter">string2</code>
   返回 &gt; 0；如果两者相等，返回 0。
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.strcoll-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.preg-match.php" class="function" rel="rdfs-seeAlso">preg_match()</a> - 执行匹配正则表达式</span></li>
    <li><span class="function"><a href="function.strcmp.php" class="function" rel="rdfs-seeAlso">strcmp()</a> - 二进制安全字符串比较</span></li>
    <li><span class="function"><a href="function.strcasecmp.php" class="function" rel="rdfs-seeAlso">strcasecmp()</a> - 二进制安全比较字符串（不区分大小写）</span></li>
    <li><span class="function"><a href="function.substr.php" class="function" rel="rdfs-seeAlso">substr()</a> - 返回字符串的子串</span></li>
    <li><span class="function"><a href="function.stristr.php" class="function" rel="rdfs-seeAlso">stristr()</a> - strstr 函数的忽略大小写版本</span></li>
    <li><span class="function"><a href="function.strncasecmp.php" class="function" rel="rdfs-seeAlso">strncasecmp()</a> - 二进制安全比较字符串开头的若干个字符（不区分大小写）</span></li>
    <li><span class="function"><a href="function.strncmp.php" class="function" rel="rdfs-seeAlso">strncmp()</a> - 二进制安全比较字符串开头的若干个字符</span></li>
    <li><span class="function"><a href="function.strstr.php" class="function" rel="rdfs-seeAlso">strstr()</a> - 查找字符串的首次出现</span></li>
    <li><span class="function"><a href="function.setlocale.php" class="function" rel="rdfs-seeAlso">setlocale()</a> - 设置区域信息</span></li>
   </ul>
  </p>
 </div>


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