©
本文档使用
php中文网手册 发布
(PHP 5 >= 5.3.11, PECL intl >= 1.0.3)
Collator::getSortKey -- collator_get_sort_key — Get sorting key for a string
面向对象风格
$str
)过程化风格
$coll
, string $str
)Return collation key for a string.
coll Collator object.
str The string to produce the key from.
Returns the collation key for the string. Collation keys can be compared directly instead of strings.
此函数可能返回布尔值
FALSE ,但也可能返回等同于 FALSE 的非布尔值。请阅读 布尔类型章节以获取更多信息。应使用
===
运算符来测试此函数的返回值。
Example #1 collator_get_sort_key() example
<?php
$s1 = 'Hello' ;
$coll = collator_create ( 'en_US' );
$res = collator_get_sort_key ( $coll , $s1 );
echo urlencode ( $res );
?> 以上例程会输出: