PHP » GoLang |
login |
register |
about
|
GoLang Collator::setStrength
request it (328)
GoLang replacement for PHP's Collator::setStrength
[edit | history]
Collator::setStrengthcollator_set_strength(PHP 5 >= 5.3.0, PHP 7, PECL intl >= 1.0.0) Collator::setStrength -- collator_set_strength — Set collation strength DescriptionObject oriented style
public
bool
Collator::setStrength
( int
$strength
)Procedural style The » ICU Collation Service supports many levels of comparison (named "Levels", but also known as "Strengths"). Having these categories enables ICU to sort strings precisely according to local conventions. However, by allowing the levels to be selectively employed, searching for a string in text can be performed with various matching conditions.
For example, people may choose to ignore accents or ignore accents and case when searching for text. Almost all characters are distinguished by the first three levels, and in most locales the default value is thus Tertiary. However, if Alternate is set to be Shifted, then the Quaternary strength can be used to break ties among whitespace, punctuation, and symbols that would otherwise be ignored. If very fine distinctions among characters are required, then the Identical strength can be used (for example, Identical Strength distinguishes between the Mathematical Bold Small A and the Mathematical Italic Small A.). However, using levels higher than Tertiary the Identical strength result in significantly longer sort keys, and slower string comparison performance for equal strings. Parameters
Return Values
Returns Examples
Example #1 collator_set_strength() example
<?php The above example will output: array ( 0 => 'ao', 1 => 'Ao', 2 => 'aò', ) array ( 0 => 'aò', 1 => 'Ao', 2 => 'ao', ) |
more
Recently updated
more
Most requested
more
Last requests
|