note 125600 added to function.strcmp
| From: | erik at eldata dot se | Date: | Sun, 13 Dec 2020 18:41:56 +0000 |
| Subject: | note 125600 added to function.strcmp | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-215979@lists.php.net to get a copy of this message | ||
strcmp and strcasecmp does not work well with multibyte (UTF8) strings and there are no mb_strcmp or
mb_strcasecmp - instead look at the wonderful Collator class with method compare (search for
Collator above) - supports not only UTF8 but also different national collations (sort orders).
Natural sort is also supported, use setAttribute to set Collator::NUMERIC_COLLATION to Collator::ON.
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.244 (proxied: 83.171.229.202)
----
Manual Page -- http://php.net/manual/en/function.strcmp.php
Edit -- https://master.php.net/note/edit/125600
Del: integrated -- https://master.php.net/note/delete/125600/integrated
Del: useless -- https://master.php.net/note/delete/125600/useless
Del: bad code -- https://master.php.net/note/delete/125600/bad+code
Del: spam -- https://master.php.net/note/delete/125600/spam
Del: non-english -- https://master.php.net/note/delete/125600/non-english
Del: in docs -- https://master.php.net/note/delete/125600/in+docs
Del: other reasons-- https://master.php.net/note/delete/125600
Reject -- https://master.php.net/note/reject/125600
Search -- https://master.php.net/manage/user-notes.php