Methods summary
final public
|
#
__construct( )
Static class - cannot be instantiated.
Static class - cannot be instantiated.
|
public static
mixed
|
#
get( array $arr, mixed $key, mixed $default = NULL )
Returns array item or $default if item is not set. Example: $val =
ArrayTools::get($arr, 'i', 123);
Returns array item or $default if item is not set. Example: $val =
ArrayTools::get($arr, 'i', 123);
Parameters
- $arr
mixed array
- $key
mixed key
- $default
mixed default value
Returns
mixed
|
public static
mixed
&
|
#
getRef( mixed & $arr, mixed $key )
Returns reference to array item or $default if item is not set.
Returns reference to array item or $default if item is not set.
Parameters
- $arr
mixed array
- $key
mixed key
Returns
mixed
|
public static
array
|
#
mergeTree( array $arr1, array $arr2 )
Recursively appends elements of remaining keys from the second array to the
first.
Recursively appends elements of remaining keys from the second array to the
first.
Parameters
Returns
array
|
public static
integer
|
#
searchKey( array $arr, mixed $key )
Searches the array for a given key and returns the offset if successful.
Searches the array for a given key and returns the offset if successful.
Parameters
- $arr
array input array
- $key
mixed key
Returns
integer offset if it is found, FALSE otherwise
|
public static
|
#
insertBefore( array & $arr, mixed $key, array $inserted )
Inserts new array before item specified by key.
Inserts new array before item specified by key.
Parameters
- $arr
array input array
- $key
mixed key
- $inserted
array inserted array
|
public static
|
#
insertAfter( array & $arr, mixed $key, array $inserted )
Inserts new array after item specified by key.
Inserts new array after item specified by key.
Parameters
- $arr
array input array
- $key
mixed key
- $inserted
array inserted array
|
public static
|
#
renameKey( array & $arr, mixed $oldKey, mixed $newKey )
Renames key in array.
Parameters
- $arr
array
- $oldKey
mixed old key
- $newKey
mixed new key
|