Méthode |
Description |
|
append ( mixed $k, mixed $v = null ) |
Inserts an element to the end of the array. |
|
changeKeyCase ( string $case ) |
Change the case of all keys in current ArrayObject. |
|
chunk ( integer $size, boolean $preserve_keys = false ) : ArrayObject |
Split an array into chunks. |
|
diff ( $array, boolean $compareKeys = false ) : ArrayObject |
Compare two arrays or ArrayObjects and returns an ArrayObject containing all the values
from current ArrayObject that are not present in any of the other array. |
|
diffKeys ( $array ) : ArrayObject |
Compare the keys from two arrays or ArrayObjects and returns an ArrayObject containing all the values
from current ArrayObject whose keys are not present in any of the other arrays. |
|
fill ( integer $start, integer $num, mixed $value ) |
Fill array with values. |
|
fillKeys ( mixed $value ) |
Use current array as keys and fill them with $value. |
|
filter ( string $callable = '' ) |
Filter array values by using a callback function. |
|
flip ( ) |
Exchanges all keys with their associated values in the array. |
|
implode ( string $glue ) : StringObject |
Implode the array with the given $glue. |
|
intersect ( $array ) |
Remove all elements from the current array that are not present in the given $array. |
|
intersectAssoc ( array $array, string $callable = '' ) |
Remove all elements from the current array that are not present in the given $array. |
|
intersectKey ( array $array, string $callable = '' ) |
Remove all elements from the current array that are not present in the given $array. |
|
join ( string $glue ) : StringObject |
Implode the array with the given $glue. |
|
key ( string | integer | StringObject $key, null | mixed $value = null, boolean $setOnlyIfDoesntExist = false ) |
Get or update the given key inside current array. |
|
keyNested ( string | integer | StringObject $key, null | mixed $value = null, boolean $setOnlyIfDoesntExist = false ) |
Get or update the given key inside current array. This method supports nested key access: 'level1.level2.level3' |
|
map ( string $callable ) |
Apply the $callback function to all elements of current array. |
|
merge ( array | ArrayObject $array ) |
Merge given $array with current array. |
|
mergeRecursive ( array | ArrayObject $array ) |
Merge given $array with current array recursively. |
|
mergeSmart ( array | ArrayObject $array ) |
Merge given $array with current array using smart algorithm. |
|
pad ( integer $size, mixed $value ) |
Pad array to the specified length with a value. |
|
prepend ( mixed $k, mixed $v = null ) |
Inserts an element at the beginning of the array. |
|
rand ( integer $num = 1 ) : ArrayObject |
Returns random elements from current array. |
|
removeFirst ( null &$assign = null ) |
Removes the first element from the array. |
|
removeKey ( string | array $key ) |
Remove the element(s) from the array under the given $key. |
|
removeLast ( null &$assign = null ) |
Removes the last element from the array. |
|
replace ( array | ArrayObject $replacements, boolean $recursive = false ) |
This method replaces the values of current array with the values from $array for the matching keys. |
|
reverse ( ) |
Reverse the order of elements in the current array. |
|
shuffle ( ) |
Shuffle elements in the array. |
|
slice ( integer $offset, null | integer $length = null, boolean $preserveKeys = true ) |
Slice a portion of current array and discard the remains. |
|
sort ( integer $direction = SORT_ASC, integer $sortFlag = SORT_REGULAR ) |
Sort the array by its values (does not maintain index association). |
|
sortAssoc ( integer $direction = SORT_ASC, integer $sortFlag = SORT_REGULAR ) |
Sort the array by its values (maintains key association). |
|
sortField ( string $field, integer $direction = SORT_ASC, integer $sortFlag = SORT_NUMERIC ) |
Sort an assoc array by a value inside the defined $field. |
|
sortKey ( integer $direction = SORT_ASC, integer $sortFlag = SORT_REGULAR ) |
Sort the array by its key. |
|
sortUsingFunction ( callable $comparisonFunction ) |
Sort an array by values using a user-defined comparison function
This function assigns new keys to the elements in array. It will remove any existing keys that may have been assigned, rather than just reordering the keys.
The comparison function must return an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second. |
|
splice ( integer $offset, integer $length, boolean $replacement ) |
Remove a portion of the array and replace it with something else. |
|
unique ( integer $sortFlag = SORT_REGULAR ) |
Remove duplicates from the array. |
|
walk ( mixed $callable, boolean $recursive = false, null $userData = null ) |
Applies the user-defined function to each element of the input array. |
|