1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00

Added string comparison function strcoll(). It uses the current locale to

do the comparisons.
@- Added localeconv() and strcoll() functions for localization. (Sean)
This commit is contained in:
Sean Bright
2001-01-17 01:10:50 +00:00
parent b8b40f697e
commit a588d65591
3 changed files with 27 additions and 1 deletions
+18
View File
@@ -210,6 +210,24 @@ PHP_FUNCTION(strcspn)
}
/* }}} */
#ifdef HAVE_STRCOLL
/* {{{ proto int strcoll(string str1, string str2)
Compare two strings using the current locale */
PHP_FUNCTION(strcoll)
{
zval **s1, **s2;
if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &s1, &s2) == FAILURE) {
WRONG_PARAM_COUNT;
}
convert_to_string_ex(s1);
convert_to_string_ex(s2);
RETURN_LONG(strcoll((const char *)(*s1)->value.str.val, (const char *)(*s2)->value.str.val));
}
#endif
PHPAPI void php_trim(zval *str, zval * return_value, int mode)
/* mode 1 : trim left
mode 2 : trim right