note 125601 added to collator.compare
| From: | erik at eldata dot se | Date: | Sun, 13 Dec 2020 18:53:05 +0000 |
| Subject: | note 125601 added to collator.compare | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215980@lists.php.net to get a copy of this message | ||
The Collator class with method compare does what the non existing mb_strcmp, mb_strcasecmp,
mb_strnatcmp and mb_strnatcasecmp would do for multibyte strings (UTF8) - but better! :-)
For "case": the Collator is case insensitive due to Collator::CASE_FIRST defaults to
Collator::OFF, but can be changed with method setAttribute.
For "nat" (natural sort order for numbers): use method setAttribute with
Collator::NUMERIC_COLLATION and Collator:ON to enable.
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.244 (proxied: 83.171.229.202)
----
Manual Page -- http://php.net/manual/en/collator.compare.php
Edit -- https://master.php.net/note/edit/125601
Del: integrated -- https://master.php.net/note/delete/125601/integrated
Del: useless -- https://master.php.net/note/delete/125601/useless
Del: bad code -- https://master.php.net/note/delete/125601/bad+code
Del: spam -- https://master.php.net/note/delete/125601/spam
Del: non-english -- https://master.php.net/note/delete/125601/non-english
Del: in docs -- https://master.php.net/note/delete/125601/in+docs
Del: other reasons-- https://master.php.net/note/delete/125601
Reject -- https://master.php.net/note/reject/125601
Search -- https://master.php.net/manage/user-notes.php