2017 © Pedro Peláez
 

library arr

A collection of utilities to manipulate arrays.

image

narrowspark/arr

A collection of utilities to manipulate arrays.

  • Sunday, September 18, 2016
  • by dani33
  • Repository
  • 1 Watchers
  • 2 Stars
  • 19,145 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 9 Versions
  • 3 % Grown

The README.md

A PHP collection of utilities to manipulate arrays. Compatible with, PHP 7 and Php 7.1., (*1)

Author Latest Version on Packagist Total Downloads Software License, (*2)

Master

Build Status Coverage Status Quality Score, (*3)

Develop

Build Status Coverage Status Quality Score, (*4)

Why?

Installation

Via Composer, (*5)

``` bash $ composer require narrowspark/arr, (*6)


or ``` json "require": { "narrowspark/arr": "~2.0" }

Arr

All methods listed under "Arr"., (*7)

``` php use Narrowspark\Arr\Arr;, (*8)

// Returns a new array with the added key and value; // ['foo' => bar, 'arr' => 'narrowsaprk'] Arr::set(['foo' => bar], 'arr', 'narrowspark');, (*9)


#### set Set an array item to a given value using "dot" notation. If no key is given to the method, the entire array will be replaced. ``` php $arr = Arr::set(['foo' => 'bar'], 'arr', 'narrowspark'); // ['foo' => 'bar', 'arr' => 'narrowspark']

get

Get an item from an array using "dot" notation. If key dont exist, you get a default value back., (*10)

``` php $arr = Arr::get(['foo' => 'bar'], 'foo', 'narrowspark'); // bar, (*11)


#### add Add an element to the array at a specific location using the "dot" notation. ``` php $arr = Arr::add(['foo' => 'bar'], 'foo', 'narrowspark'); // ['foo' => ['bar', 'narrowspark']]

has

Check if an item exists in an array using "dot" notation., (*12)

``` php $arr = Arr::has(['foo' => 'bar'], 'foo'); // true, (*13)


#### update Updates data at the given path. ``` php $increment = function ($value) { return $value + 1; }; $arr = Arr::update(['foo' => 1], $increment); // ['foo' => 2]

forget

Remove one or many array items from a given array using "dot" notation., (*14)

``` php $arr = ['foo' => 'bar'], (*15)

Arr::forget($arr, 'foo');

$arr; // []

```, (*16)

Change log

Please see CHANGELOG for more information what has changed recently., (*17)

Testing

From the project directory, tests can be ran using phpunit, (*18)

Contributing

Please see CONTRIBUTING for details., (*19)

Credits

License

The MIT License (MIT). Please see License File for more information., (*20)

The Versions

18/09 2016

dev-master

9999999-dev https://github.com/narrowspark/arr

A collection of utilities to manipulate arrays.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

array manipulate

18/09 2016

v2.1.1

2.1.1.0 https://github.com/narrowspark/arr

A collection of utilities to manipulate arrays.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

array manipulate

18/09 2016

dev-develop

dev-develop https://github.com/narrowspark/arr

A collection of utilities to manipulate arrays.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

array manipulate

17/09 2016

v2.1.0

2.1.0.0 https://github.com/narrowspark/arr

A collection of utilities to manipulate arrays.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

array manipulate

16/09 2016

v2.0.0

2.0.0.0 https://github.com/narrowspark/arr

A collection of utilities to manipulate arrays.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

array manipulate

15/09 2016

v1.2.0

1.2.0.0 https://github.com/narrowspark/arr

A collection of utilities to manipulate arrays.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

array manipulate

08/06 2016

v1.1.0

1.1.0.0 https://github.com/narrowspark/arr

A collection of utilities to manipulate arrays.

  Sources   Download

MIT

The Requires

  • php ^5.6 || ^7.0

 

The Development Requires

array manipulate

28/04 2016

v1.0.1

1.0.1.0 https://github.com/narrowspark/arr

A collection of utilities to manipulate arrays.

  Sources   Download

MIT

The Requires

  • php >=5.6.4

 

The Development Requires

array manipulate

14/01 2016