note 24730 added to function.strcoll
| From: | php-general at lists dot php dot net | Date: | Tue, 27 Aug 2002 11:05:54 +0000 |
| Subject: | note 24730 added to function.strcoll | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-35720@lists.php.net to get a copy of this message | ||
Note that some platforms implement strcmp() and strcasecmp() according to the current locale when
strings are not binary equal, so that strcmp() and strcoll() will return the same value! This
depends on how the PHP strcmp() function is compiled (i.e. if it uses the platform specific strcmp()
found in its standard library!).
In that case, the only difference between strcoll() and strcmp() is that strcoll() may return 0 for
distinct strings(i.e. consider strings are equal) while strcmp() will differentiate them if they
have distinct binary encoding! This typically occurs on Asian systems.
What you can be sure is that strcmp() will always differentiate strings that are encoded
differently, but the relative order may still use the current locale setting for collation order!
--
http://www.php.net/manual/en/function.strcoll.php
http://master.php.net/manage/user-notes.php?action=edit+24730
http://master.php.net/manage/user-notes.php?action=delete+24730
http://master.php.net/manage/user-notes.php?action=reject+24730