Back to index

php5  5.3.10
Classes | Functions
collator_api.php File Reference

Go to the source code of this file.

Classes

class  Collator
 Collator class. More...

Functions

 collator_create ($locale)
 Create collator.
 collator_compare ($coll, $str1, $str2)
 Compare two strings.
 collator_sort ($coll, $arr, $sort_flags)
 Sort array using specified collator.
 collator_asort ($coll, $arr, $sort_flags)
 Sort array maintaining index association.
 collator_sort_with_sort_keys ($coll, $arr)
 Sort array using specified collator.
 collator_get_locale ($coll, $type)
 Get the locale name of the collator.
 collator_get_attribute ($coll, $attr)
 Get collation attribute value.
 collator_get_strength ($coll)
 Get current collation strength.
 collator_set_strength ($coll, $strength)
 Set collation strength.
 collator_set_attribute ($coll, $attr, $val)
 Set collation attribute.
 collator_get_error_code ($coll)
 Get collator's last error code.
 collator_get_error_message ($coll)
 Get text for collator's last error code.

Function Documentation

collator_asort ( coll,
arr,
sort_flags 
)

Sort array maintaining index association.

Parameters:
Collator$collCollator object.
array$arrArray of strings to sort.
int$sort_flagsOptional sorting type.
Returns:
bool true on success or false on failure.
See also:
collator_sort()

Definition at line 308 of file collator_api.php.

{}

Here is the caller graph for this function:

collator_compare ( coll,
str1,
str2 
)

Compare two strings.

The strings will be compared using the options already specified.

Parameters:
Collator$collCollator object.
string$str1The first string to compare.
string$str2The second string to compare.
Returns:
int 1 if $str1 is greater than $str2; 0 if $str1 is equal to $str2; -1 if $str1 is less than $str2. On error false is returned.

Definition at line 280 of file collator_api.php.

{}

Here is the caller graph for this function:

collator_create ( locale)

Create collator.

Parameters:
string$localeThe locale containing the required collation rules. Special values for locales can be passed in - if null is passed for the locale, the default locale collation rules will be used. If empty string ("") or "root" are passed, UCA rules will be used.
Returns:
Collator New instance of Collator object, or null on error.

Definition at line 262 of file collator_api.php.

{}

Here is the caller graph for this function:

collator_get_attribute ( coll,
attr 
)

Get collation attribute value.

Parameters:
Collator$collCollator object.
int$attrAttribute to get value for.
Returns:
int Attribute value, or false on error.

Definition at line 347 of file collator_api.php.

{}

Here is the caller graph for this function:

Get collator's last error code.

Parameters:
Collator$collCollator object.
Returns:
int Error code returned by the last Collator API function call.

Definition at line 387 of file collator_api.php.

{}

Here is the caller graph for this function:

Get text for collator's last error code.

Parameters:
Collator$collCollator object.
Returns:
string Description of an error occured in the last Collator API function call.

Definition at line 397 of file collator_api.php.

{}

Here is the caller graph for this function:

collator_get_locale ( coll,
type 
)

Get the locale name of the collator.

Parameters:
Collator$collCollator object.
int$typeYou can choose between valid and actual locale (ULOC_VALID_LOCALE, ULOC_ACTUAL_LOCALE respectively).
Returns:
string Real locale name from which the collation data comes. If the collator was instantiated from rules or an error occured, returns false.

Definition at line 337 of file collator_api.php.

{}

Here is the caller graph for this function:

collator_get_strength ( coll)

Get current collation strength.

Parameters:
Collator$collCollator object.
Returns:
int Current collation strength, or false on error.

Definition at line 356 of file collator_api.php.

{}

Here is the caller graph for this function:

collator_set_attribute ( coll,
attr,
val 
)

Set collation attribute.

Parameters:
Collator$collCollator object.
int$attrAttribute.
int$valAttribute value.
Returns:
bool true on success, false otherwise.

Definition at line 377 of file collator_api.php.

{}

Here is the caller graph for this function:

collator_set_strength ( coll,
strength 
)

Set collation strength.

Parameters:
Collator$collCollator object.
int$strengthStrength to set.
Returns:
bool true on success, false otherwise.

Definition at line 366 of file collator_api.php.

{}

Here is the caller graph for this function:

collator_sort ( coll,
arr,
sort_flags 
)

Sort array using specified collator.

Parameters:
Collator$collCollator object.
array$arrArray of strings to sort.
int$sort_flagsOptional sorting type, one of the following:
  • SORT_REGULAR - compare items normally (don't change types)
  • SORT_NUMERIC - compare items numerically
  • SORT_STRING - compare items as strings Default sorting type is SORT_REGULAR.
Returns:
bool true on success or false on failure.

Definition at line 295 of file collator_api.php.

{}

Here is the caller graph for this function:

collator_sort_with_sort_keys ( coll,
arr 
)

Sort array using specified collator.

Similar to collator_sort(). Uses ICU ucol_getSortKey() to gain more speed on large arrays.

Parameters:
Collator$collCollator object.
array$arrArray of strings to sort
Returns:
bool true on success or false on failure.

Definition at line 321 of file collator_api.php.

{}

Here is the caller graph for this function: