omissis / arrayfunctions
Functions to manipulate arrays
Installs: 12 375
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Requires
- php: >=5.6
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-11-26 20:33:38 UTC
README
PHP Utilities to operate on arrays.
use Omissis\ArrayFunctions; use function Omissis\ArrayFunctions\get as array_get; use function Omissis\ArrayFunctions\set as array_set; // Retrieve a value by its key, optionally returning a default if the value is not found. // $key can be a string or an array representing the path to the key you are interested into. ArrayFunctions\get($array, $key, $default); // Alternatively, use the function alias array_get($array, $key, $default); // Set the value of a key, returning the previous value if it was set. // $key can be a string or an array representing the path to the key you are interested into. ArrayFunctions\set($array, $key, $value) // Alternatively, use the function alias array_set($array, $key, $value);
Installation
You can install ArrayFunctions with Composer:
composer require omissis/arrayfunctions
Run composer install
or composer update
and you're ready to start.