Static Public Member Functions | |
static | callback_string ($str) |
Return a callback array from a string, eg: limit[10,20] would become array('limit', array('10', '20')) | |
static | rotate ($source_array, $keep_keys=TRUE) |
Rotates a 2D array clockwise. | |
static | remove ($key, &$array) |
Removes a key from an array and returns the value. | |
static | extract ($search, $keys) |
Extract one or more keys from an array. | |
static | unshift_assoc (&$array, $key, $val) |
Because PHP does not have this function. | |
static | map_recursive ($callback, $array) |
Because PHP does not have this function, and array_walk_recursive creates references in arrays and is not truly recursive. | |
static | binary_search ($needle, $haystack, $nearest=FALSE, $sort=FALSE) |
Binary search algorithm. | |
static | merge () |
Emulates array_merge_recursive, but appends numeric keys and replaces associative keys, instead of appending all keys. | |
static | overwrite ($array1) |
Overwrites an array with values from input array(s). | |
static | range ($step=10, $max=100) |
Fill an array with a range of numbers. | |
static | to_object (array $array, $class= 'stdClass', $recursively=TRUE) |
Recursively convert an array to an object. | |
static | from_object ($object) |
Creates array from object. | |
static | tolower ($array=array()) |
Transforms array to lower. | |
static | from_objects ($objects, $attribute= 'name') |
Converts array of objects to classic array in format: key = id of object, value = attributte. | |
static | from_string ($string, $length, $offset=0) |
Creates array from string. | |
static | variation ($array, $class) |
Returns variation of array. | |
static | search ($needle, $haystack) |
Searchs in array. | |
static | sort ($array) |
Sorts array, almost same as default PHP sort function, but it doesn't edit original array and returns new array. | |
static | ksort ($array) |
Similar to sort, but sort by key. | |
static | min_key ($array) |
Returns key with minimal value from array. | |
static | max_key ($array) |
Returns key with maximal value from array. | |
static | bool () |
Return translated bool array (yes, no) | |
static | rbool () |
Return reverted translated bool array (no, yes) | |
static | trim ($array=array(), $charlist= '') |
Remove values given by charlist (seperated by comma) from array. |
|
static |
Binary search algorithm.
mixed | the value to search for |
array | an array of values to search in |
boolean | return false, or the nearest value |
mixed | sort the array before searching it |
|
static |
Return translated bool array (yes, no)
|
static |
Return a callback array from a string, eg: limit[10,20] would become array('limit', array('10', '20'))
string | callback string |
|
static |
Extract one or more keys from an array.
Each key given after the first argument (the array) will be extracted. Keys that do not exist in the search array will be NULL in the extracted data.
array | array to search |
string | key name |
|
static |
Creates array from object.
mixed | $object |
|
static |
Converts array of objects to classic array in format: key = id of object, value = attributte.
$objects | array of object to convert |
$attribute | name of attributte to store as value of array |
|
static |
Creates array from string.
string | $string | |
integer | $length | |
integer | $offset |
|
static |
Similar to sort, but sort by key.
type | $array |
|
static |
Because PHP does not have this function, and array_walk_recursive creates references in arrays and is not truly recursive.
mixed | callback to apply to each member of the array |
array | array to map to |
|
static |
Returns key with maximal value from array.
type | $array |
|
static |
Emulates array_merge_recursive, but appends numeric keys and replaces associative keys, instead of appending all keys.
array | any number of arrays |
|
static |
Returns key with minimal value from array.
type | $array |
|
static |
Overwrites an array with values from input array(s).
Non-existing keys will not be appended!
array | key array |
array | input array(s) that will overwrite key array values |
|
static |
Fill an array with a range of numbers.
integer | stepping |
integer | ending number |
|
static |
Return reverted translated bool array (no, yes)
|
static |
Removes a key from an array and returns the value.
string | key to return |
array | array to work on |
|
static |
Rotates a 2D array clockwise.
Example, turns a 2x3 array into a 3x2 array.
array | array to rotate |
boolean | keep the keys in the final rotated array. the sub arrays of the source array need to have the same key values. if your subkeys might not match, you need to pass FALSE here! |
|
static |
Searchs in array.
string | $needle | |
array | $haystack |
|
static |
Sorts array, almost same as default PHP sort function, but it doesn't edit original array and returns new array.
array | $array |
|
static |
Recursively convert an array to an object.
array | array to convert |
|
static |
Transforms array to lower.
array | $array |
|
static |
Remove values given by charlist (seperated by comma) from array.
type | $array | |
type | $charlist |
|
static |
Because PHP does not have this function.
array | array to unshift |
string | key to unshift |
mixed | value to unshift |
|
static |
Returns variation of array.
array | $array | |
integer | $class |