Download the PHP package theodorejb/array-utils without Composer
On this page you can find all versions of the php package theodorejb/array-utils. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download theodorejb/array-utils
More information about theodorejb/array-utils
Files in theodorejb/array-utils
Package array-utils
Short Description Useful functions for working with arrays
License MIT
Informations about the package array-utils
ArrayUtils
ArrayUtils is a collection of useful PHP array functions.
Install via Composer
composer require theodorejb/array-utils
Methods
containsAll
Returns true if all the needles are in the haystack.
containsSame
Returns true if both arrays contain the same values (regardless of order).
groupRows
Splits the iterable of arrays into groups when the value of one or more keys changes. The iterable must be sorted by the array keys used to group results.
requireStrKey
Returns the specified array key value if it is a string. Throws an exception otherwise.
getOptionalStrKey
Returns the specified array key value if it is a string, or null
if the array key doesn't exist.
Throws an exception if the key exists but the value is not a string.
requireNumericKey
Returns the specified array key value as a float if it is an integer or float. Throws an exception otherwise.
getOptionalNumericKey
Returns the specified array key value as a float if it is an integer or float, or null
if the array key doesn't exist.
Throws an exception if the key exists but the value is not an integer or float.
requireIntKey
Returns the specified array key value if it is an integer. Throws an exception otherwise.
getOptionalIntKey
Returns the specified array key value if it is an integer, or null
if the array key doesn't exist.
Throws an exception if the key exists but the value is not an integer.
requireBoolKey
Returns the specified array key value if it is a boolean. Throws an exception otherwise.
getOptionalBoolKey
Returns the specified array key value if it is a boolean, or null
if the array key doesn't exist.
Throws an exception if the key exists but the value is not a boolean.
Author
Theodore Brown
https://theodorejb.me
License
MIT