Collator
PHP Manual

Collator::getSortKey

collator_get_sort_key

(バージョン情報なし。おそらく SVN 版にしか存在しないでしょう)

Collator::getSortKey -- collator_get_sort_keyGet sorting key for a string

説明

Object oriented style

string Collator::getSortKey ( string $str )

Procedural style

string collator_get_sort_key ( Collator $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 として評価される 0 や "" といった値を返す可能性もあります。 詳細については 論理値の セクションを参照してください。この関数の返り値を調べるには ===演算子 を 使用してください。

例1 collator_get_sort_key()example

<?php
$s1 
'Hello';

$coll collator_create'en_US' );
$res  collator_get_sort_key$coll$s1);

echo 
urlencode($res);
?>

上の例の出力は以下となります。


71%3F%3FE%01%09%01%8F%08%00

参考


Collator
PHP Manual