Railo 4.2 Reference
Choose a function:

Function ARRAYSORT

Sorts array elements numerically or alphanumerically.

Beispiel

arraysort(array array,object sorttype_or_closure,[string sort_order,[boolean locale_sensitive]]):boolean

Argumente

Die Argumente für diese Funktion sind fest vorgegeben. Ausser den nachfolgenden Argumenten dürfen keine weiteren verwendet werden.
Name Typ Required Beschreibung
array array  Yes Name of an array  
sorttype_or_closure object  Yes value can be a string or a closure/function.

a string must be one of the following values:
  • "numeric": sorts numbers
  • "text": sorts text alphabetically, taking case into account (case sensitive)
  • "textnocase": sorts text alphabetically, without regard to case (case insensitive)

    if you define a closure/function, the closure/function must accept 2 parameters of any type and return:
  • 1, if first parameter is "smaller" than second parameter
    0, if first parameter is equal to second parameter
    1, first parameter is "bigger" than second parameter  
  • sort_order string  No sort direction:
  • asc(default): ascending sort order
  • desc: descending sort order.  
  • locale_sensitive boolean  No if true it does a locale sensitive sorting.