Collator::getSortKey
collator_get_sort_key
(PHP 5 >= 5.3.11, PECL intl >= 1.0.3)
Collator::getSortKey -- collator_get_sort_key — Get sorting key for a string
Descrierea
Stil obiect-orientat
string
Collator::getSortKey
( string
$str
)Stil procedural
Return collation key for a string.
Valorile întoarse
Returns the collation key for the string. Collation keys can be compared directly instead of strings.
Avertizare
Această funcție poate întoarce valoarea Boolean FALSE, dar poate de
asemenea întoarce o valoare non-Boolean care evaluează în FALSE, cum ar fi
0 sau "". Vă rugăm să citiți secțiunea despre
tipul Boolean pentru mai multe
informații. Utilizați
operatorul === pentru a
verifica valoarea întoarsă de această funcție.
Exemple
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);
?>
Exemplul de mai sus va afișa:
71%3F%3FE%01%09%01%8F%08%00
Vedeți de asemenea
- collator_sort() - Sort array using specified collator
- collator_sort_with_sort_keys() - Sort array using specified collator and sort keys
There are no user contributed notes for this page.
