Collator
PHP Manual

Collator::getSortKey

collator_get_sort_key

(No version information available, might only be in SVN)

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

Descripción

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.

Parámetros

coll

Collator object.

str

The string to produce the key from.

Valores devueltos

Returns the collation key for the string. Collation keys can be compared directly instead of strings.

Warning

Esta función quizá devuelve Boolean FALSE, pero quizá también devuelve un valor non-Boolean que se evaluará como FALSE, como 0 o "". Por favor lea la sección en Booleans para más información. Use el operador === para testear el valor devuelto por esta función.

Ejemplos

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);
?>

El resultado del ejemplo sería:


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

Ver también


Collator
PHP Manual