Novis\Intl\Collator
Sorts strings by the rules of a language and region. Each method takes a whole list and a locale tag, such as "de" or "sv-SE", and sorts the whole list in one call.
Members
2 members.
| Member | Signature |
|---|---|
sort | sort(array<string> $strings, string $locale, ?CollateOptions $options = null): array<string> |
sortKeys | sortKeys(array<string> $strings, string $locale, ?CollateOptions $options = null): array<bytes> |
Enums
Strength { Primary, Secondary, Tertiary, Quaternary, Identical }Which differences between two strings count whenCollatorsorts them.Collatorsorts strings by the rules of a language.Primarycompares the letters only, so "resume" and "Résumé" are equal.Secondaryalso compares accents.Tertiaryalso compares upper and lower case. This is the default.ignorePunctuationis another option ofCollator. When it istrue,Primary,SecondaryandTertiarydo not compare punctuation.Quaternaryalso compares that punctuation.Identicalalso compares the characters themselves when everything else is equal.CaseFirst { Off, Upper, Lower }Whether uppercase or lowercase letters come first whenCollatorsorts words that differ only in case.Collatorsorts strings by the rules of a language.Offis the default. It follows the rules of the language. In English, it puts "apple" before "Apple".Upperputs "Apple" first.Lowerputs "apple" first.
