Array helper class.
package | Core |
---|---|
subpackage | Array |
csort() : array
Found at http://us2.php.net/manual/en/function.array-multisort.php Syntax:
$new_array = cArray::csort($array [, 'col1' [, SORT_FLAG [, SORT_FLAG]]]...);
Explanation: $array is the array you want to sort, 'col1' is the name of the column you want to sort, SORT_FLAGS are : SORT_ASC, SORT_DESC, SORT_REGULAR, SORT_NUMERIC, SORT_STRING you can repeat the 'col',FLAG,FLAG, as often you want, the highest prioritiy is given to the first - so the array is sorted by the last given column first, then the one before ... Example:
$array = cArray::csort($array,'town','age', SORT_DESC, 'name');
array
initializeKey($aArray, $sKey, $mDefault)
searchRecursive(array $arr, mixed $search, bool $partial, bool $strict) : mixed | bool
TODO | : Ask timo to document this. Note: If subarrays exists, this function currently returns the key of the array given by $arr, and not from the subarrays (todo: add flag to allow this) |
---|
array
The array to search
mixed
The value to search in the array
bool
bool
mixed
bool
The key/index of the array containing the searched value or false.sortWithLocale(array $arr, string $locale) : array
array
The array to sort
string
The locale to change before sorting
array
Sorted arraytrim(array $arr, string $charlist) : array
Similar to trim() function.
array
string
array
The trimmer array