A PHP collection of utilities to manipulate arrays. Compatible with PHP 5.6+, PHP 7, and HHVM.
Via Composer
$ composer require narrowspark/arr
or
"require": {
"narrowspark/arr": "~1.0"
}
All methods listed under "Instance methods" are available as part of a wrapper.
use Narrowspark\Arr\Arr;
use Narrowspark\Arr\StaticArr;
// Translates to Access::set(['foo' => bar], 'arr', 'narrowspark');
// Returns a new array with the added key and value;
// ['foo' => bar, 'arr' => 'narrowsaprk']
(new Arr())->set(['foo' => bar], 'arr', 'narrowspark');
// or you can make a static call
StaticArr::set(['foo' => bar], 'arr', 'narrowspark');
Please see CHANGELOG for more information what has changed recently.
From the project directory, tests can be ran using phpunit
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.