equip / assist
Everyone needs a little assistance
Installs: 85 236
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 10
Forks: 2
Open Issues: 2
Requires
- php: >=5.5
Requires (Dev)
- lstrojny/functional-php: <=1.2.4
Suggests
- phpbench/phpbench: Install globally to run benchmarks
- phpunit/phpunit: Install globally to run unit tests
README
Everyone needs a little assistance! Attempts to be PSR-1 and PSR-2 compliant.
Array Functions
All array functions:
- put the array as the first parameter
- work with both arrays and
Traversable
parameters
Import any function with use function Equip\Arr\func;
.
List of functions
exists($source, $key)
check if a key exists in an array.
to_array($value)
convert a value to an array.
get($source, $key, $default)
get a value from an array, or the default.
some($source, $keys)
get some values from an array.
without($source, $keys)
get an array without some values.
expect($source, $keys, $default)
get some values from an array, ensuring all keys are defined.
head($list)
get the first value from a list.
tail($list)
get the last value from a list.
index_by($source, $key)
index a collection by a key.
column($source, $column)
get a list of values from a collection.
typed($source, $types)
type cast defined values in an array.