ArrayUtil
class ArrayUtil (View source)
Various PHP array related utility functions.
Methods
Find an item in an associative array by a key value, or return null if not found.
Find an item in an associative array by a key value, or return default if not found.
Merge a number of arrays using a case insensitive comparison for the array keys.
Checks whether an array's keys are associative. An array's keys are associate if they are not values 0 to count(array) - 1.
Checks whether every value in an array passes the provided predicate.
Checks whether every value in an array is an instance of a class.
Details
at line 37
static mixed
findByKeyOrNull(array $array, mixed $key)
Find an item in an associative array by a key value, or return null if not found.
at line 52
static mixed
findByKeyOrDefault(array $array, mixed $key, mixed $default)
Find an item in an associative array by a key value, or return default if not found.
at line 70
static
arrayMergeIgnoreCase()
Merge a number of arrays using a case insensitive comparison for the array keys.
at line 107
static bool
isAssociative(array $arr)
Checks whether an array's keys are associative. An array's keys are associate if they are not values 0 to count(array) - 1.
at line 123
static bool
all(array $array, callable $predicate)
Checks whether every value in an array passes the provided predicate.
at line 144
static bool
allInstanceOf(array $array, $class)
Checks whether every value in an array is an instance of a class.