[svn r21528] FS#306 - The multi-byte string library: Adding new functions for reverse string comparisons - api_strcasercmp(), api_strrcmp(), api_strnatcasercmp(), api_strnatrcmp(). They are handy to be used as callback functions.
@ -1033,7 +1033,7 @@ function api_add_pcre_unicode_modifier($pcre, $encoding = null) {
* @param string $string2 The second string.
* @param string $language (optional) The language in which comparison is to be made. If language is omitted, interface language is assumed then.
* @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return int Returns <0if$string1islessthan$string2;> 0 if $string1 is greater than $string2; and 0 if the strings are equal.
* @return int Returns <0if$string1islessthan$string2;> 0 if $string1 is greater than $string2; and 0 if the strings are equal.
* This function is aimed at replacing the function strcasecmp() for human-language strings.
* Performs reverse string comparison, case insensitive, language sensitive, with extended multibyte support.
* @param string $string1 The first string.
* @param string $string2 The second string.
* @param string $language (optional) The language in which comparison is to be made. If language is omitted, interface language is assumed then.
* @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return int Returns <0if$string2islessthan$string1;> 0 if $string2 is greater than $string1; and 0 if the strings are equal.
*/
function api_strcasercmp($string1, $string2, $language = null, $encoding = null) {
* Performs string comparison, case sensitive, language sensitive, with extended multibyte support.
* @param string $string1 The first string.
* @param string $string2 The second string.
* @param string $language (optional) The language in which comparison is to be made. If language is omitted, interface language is assumed then.
* @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return int Returns <0if$string1islessthan$string2;> 0 if $string1 is greater than $string2; and 0 if the strings are equal.
* @return int Returns <0if$string1islessthan$string2;> 0 if $string1 is greater than $string2; and 0 if the strings are equal.
* This function is aimed at replacing the function strcmp() for human-language strings.
* Performs reverse string comparison, case sensitive, language sensitive, with extended multibyte support.
* @param string $string1 The first string.
* @param string $string2 The second string.
* @param string $language (optional) The language in which comparison is to be made. If language is omitted, interface language is assumed then.
* @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return int Returns <0if$string2islessthan$string1;> 0 if $string2 is greater than $string1; and 0 if the strings are equal.
*/
function api_strrcmp($string1, $string2, $language = null, $encoding = null) {
* Performs string comparison in so called "natural order", case insensitive, language sensitive, with extended multibyte support.
* @param string $string1 The first string.
* @param string $string2 The second string.
* @param string $language (optional) The language in which comparison is to be made. If language is omitted, interface language is assumed then.
* @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return int Returns <0if$string1islessthan$string2;> 0 if $string1 is greater than $string2; and 0 if the strings are equal.
* @return int Returns <0if$string1islessthan$string2;> 0 if $string1 is greater than $string2; and 0 if the strings are equal.
* This function is aimed at replacing the function strnatcasecmp() for human-language strings.
* Performs reverse string comparison in so called "natural order", case insensitive, language sensitive, with extended multibyte support.
* @param string $string1 The first string.
* @param string $string2 The second string.
* @param string $language (optional) The language in which comparison is to be made. If language is omitted, interface language is assumed then.
* @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return int Returns <0if$string2islessthan$string1;> 0 if $string2 is greater than $string1; and 0 if the strings are equal.
*/
function api_strnatcasercmp($string1, $string2, $language = null, $encoding = null) {
* Performs reverse string comparison in so called "natural order", case sensitive, language sensitive, with extended multibyte support.
* @param string $string1 The first string.
* @param string $string2 The second string.
* @param string $language (optional) The language in which comparison is to be made. If language is omitted, interface language is assumed then.
* @param string $encoding (optional) The used internally by this function character encoding. If it is omitted, the platform character set will be used by default.
* @return int Returns <0if$string2islessthan$string1;> 0 if $string2 is greater than $string1; and 0 if the strings are equal.
*/
function api_strnatrcmp($string1, $string2, $language = null, $encoding = null) {