diff options
author | Derick Rethans <derick@php.net> | 2004-09-11 14:22:35 +0000 |
---|---|---|
committer | Derick Rethans <derick@php.net> | 2004-09-11 14:22:35 +0000 |
commit | 4bae5cb4d051b50d8c1ffac90affca36a8429f6b (patch) | |
tree | 148a00eff682ab89f208b5057ddf54350d8138de /ext/standard/array.c | |
parent | b3a32e6d2165a9a97681ea0c57fcb986091e79cf (diff) | |
download | php-git-4bae5cb4d051b50d8c1ffac90affca36a8429f6b.tar.gz |
- MFB: Added the sorting flag SORT_LOCALE_STRING to the sort() functions which
makes them sort based on the current locale. (Derick)
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r-- | ext/standard/array.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c index 29f659e97f..fbbe08678f 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -65,6 +65,7 @@ php_array_globals array_globals; #define SORT_REGULAR 0 #define SORT_NUMERIC 1 #define SORT_STRING 2 +#define SORT_LOCALE_STRING 5 #define SORT_DESC 3 #define SORT_ASC 4 @@ -114,6 +115,8 @@ PHP_MINIT_FUNCTION(array) REGISTER_LONG_CONSTANT("SORT_REGULAR", SORT_REGULAR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SORT_NUMERIC", SORT_NUMERIC, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("SORT_STRING", SORT_STRING, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("SORT_LOCALE_STRING", SORT_LOCALE_STRING, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("CASE_LOWER", CASE_LOWER, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("CASE_UPPER", CASE_UPPER, CONST_CS | CONST_PERSISTENT); @@ -143,6 +146,12 @@ static void set_compare_func(int sort_type TSRMLS_DC) ARRAYG(compare_func) = string_compare_function; break; +#if HAVE_STRCOLL + case SORT_LOCALE_STRING: + ARRAYG(compare_func) = string_locale_compare_function; + break; +#endif + case SORT_REGULAR: default: ARRAYG(compare_func) = compare_function; |