PHPackages                             chipslays/array - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chipslays/array

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

chipslays/array
===============

Library for array manipulate.

1.1.2(4y ago)01.2k1MITPHP

Since Jan 13Pushed 4y ago1 watchersCompare

[ Source](https://github.com/chipslays/array)[ Packagist](https://packagist.org/packages/chipslays/array)[ RSS](/packages/chipslays-array/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (7)Dependencies (1)Versions (8)Used By (1)

🧰 Array
=======

[](#-array)

[![Tests](https://github.com/chipslays/array/actions/workflows/tests.yml/badge.svg)](https://github.com/chipslays/array/actions/workflows/tests.yml)[![Packagist Version](https://camo.githubusercontent.com/0e20fb5fcdada4c6b92a65c1dc78b999daf846c44081d6a9bad752f52ce834c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63686970736c6179732f6172726179)](https://camo.githubusercontent.com/0e20fb5fcdada4c6b92a65c1dc78b999daf846c44081d6a9bad752f52ce834c7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f63686970736c6179732f6172726179)

Simple library for array manipulate.

> Supported dot-notation and asterisks rules.

Installation
------------

[](#installation)

```
$ composer require chipslays/array
```

Documentation
-------------

[](#documentation)

> **Notice:** Class `Collection` implements `Countable` and `ArrayAccess`.

### Methods

[](#methods)

#### `get(array $array, $keys [, $default = null, string $separator = '.'])`

[](#getarray-array-keys--default--null-string-separator--)

Get value from array using by dot notation key.

Has helper `arr_get()`.

```
use Chipslays\Arr\Arr;

$array = [
    'user' => [
        'name' => 'chipslays'
    ],
];

$name = Arr::get($array, 'user.name'); // chipslays
$email = Arr::get($array, 'user.email', 'default@email.com'); // default@email.com
```

```
$array = [
    'foo' => [
        'bar' => ['baz' => 1],
        'bam' => ['baz' => 2],
        'boo' => ['baz' => 3],
    ],
];

$results = arr_get($array, 'foo.*.baz');

// Array
// (
//     [0] => 1
//     [1] => 2
//     [2] => 3
// )
```

```
$array = [
    'foo' => [
        'bar' => ['baz' => 1],
    ],
];

$results = arr_get($array, 'foo.*.baz');

// 1
```

```
$array = [
    'foo' => [
        'bar' => ['baz' => 1],
        'bam' => ['baz' => 2],
        'boo' => ['baz' => 3],
    ],
];

$results = arr_get($array, 'foo.*');

// Array
// (
//     [0] => Array
//         (
//             [baz] => 1
//         )
//     [1] => Array
//         (
//             [baz] => 2
//         )
//     [2] => Array
//         (
//             [baz] => 3
//         )
// )
```

```
$array = [
    'foo' => [
        'bar' => ['baz' => 1],
    ],
];

$results = arr_get($array, 'foo.*');

// Array
// (
//     [baz] => 1
// )
```

#### `set(array &$array, string $keys, $value = null [, string $separator = '.']) : void`

[](#setarray-array-string-keys-value--null--string-separator----void)

Set/overwrite value in array using by dot notation key.

Has helper `arr_set()`.

```
use Chipslays\Arr\Arr;

$array = [
    'user' => [
        'name' => 'chipslays'
    ],
];

Arr::set($array, 'user.name', 'john doe');
Arr::set($array, 'user.email', 'john.doe@email.com');

Array
(
    [user] => Array
        (
            [name] => john doe
            [email] => john.doe@email.com
        )

)
```

#### `has(array $array, $keys [, string $separator = '.']): bool`

[](#hasarray-array-keys--string-separator---bool)

Check exists value in array using by dot notation key.

Has helper `arr_has()`.

```
use Chipslays\Arr\Arr;

$array = [
    'user' => [
        'name' => 'chipslays',
        'string' => '',
        'null' => null,
        'false' => false,
    ],
];

Arr::has($array, 'user.name'); // true
Arr::has($array, 'user.string'); // true
Arr::has($array, 'user.null'); // true
Arr::has($array, 'user.false'); // true
Arr::has($array, 'user.empty_value'); // false
```

#### `where(array $array, callable $callback)`

[](#wherearray-array-callable-callback)

Filter the array using the given callback.

Has helper `arr_where()`.

```
use Chipslays\Arr\Arr;

$array = [
    'user' => [
        'name' => 'chipslays',
        'string' => '',
        'null' => null,
        'false' => false,
    ],
];

// todo
```

👀 See also
----------

[](#-see-also)

- [`chipslays/collection`](https://github.com/chipslays/collection) - Simple library for manipulating array or object as collection.

License
-------

[](#license)

MIT

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Total

7

Last Release

1781d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19103498?v=4)[chipslays](/maintainers/chipslays)[@chipslays](https://github.com/chipslays)

---

Top Contributors

[![chipslays](https://avatars.githubusercontent.com/u/19103498?v=4)](https://github.com/chipslays "chipslays (24 commits)")

---

Tags

arrayarray-manipulations

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chipslays-array/health.svg)

```
[![Health](https://phpackages.com/badges/chipslays-array/health.svg)](https://phpackages.com/packages/chipslays-array)
```

###  Alternatives

[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[mickgeek/yii2-actionbar

A control bar with bulk actions for the GridView widget.

3444.5k](/packages/mickgeek-yii2-actionbar)[miracuthbert/laravel-royalty

A user points package for Laravel that can be used to give rewards, loyalty or experience points with real time support

825.1k](/packages/miracuthbert-laravel-royalty)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
