PHPackages                             wake/php-array-kit - 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. wake/php-array-kit

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

wake/php-array-kit
==================

Simple functions help using array in php

v0.4.2(6y ago)03742MITPHPPHP &gt;=5.2.0

Since Nov 23Pushed 6y ago1 watchersCompare

[ Source](https://github.com/wake/php-array-kit)[ Packagist](https://packagist.org/packages/wake/php-array-kit)[ Docs](https://github.com/wake/php-array-kit)[ RSS](/packages/wake-php-array-kit/feed)WikiDiscussions master Synced today

READMEChangelog (3)DependenciesVersions (8)Used By (2)

PHP Array Kit
=============

[](#php-array-kit)

Simple functions help using array in php.

Usage
-----

[](#usage)

### `keyi ($array, $key, $gather = false)`

[](#keyi-array-key-gather--false)

Split array base on key

```
  $input = [
    ['id' => 'A', 'title' => 'A apple', 'value' => 10],
    ['id' => 'B', 'title' => 'B bear',  'value' => 27],
    ['id' => 'C', 'title' => 'C Cat',   'value' => 10],
  ];

  // Split array base on key

  $output = keyi ($input, 'id');

  /*
  [
    'A' => ['id' => 'A', 'title' => 'A apple', 'value' => 10],
    'B' => ['id' => 'B', 'title' => 'B bear',  'value' => 27],
    'C' => ['id' => 'C', 'title' => 'C Cat',   'value' => 10],
  ];
  */

  // Base on multiple keys

  $output = keyi ($input, ['id', 'title']);

  /*
  [
    'A' => [
      'A apple' => ['id' => 'A', 'title' => 'A apple', 'value' => 10]
    ],
    'B' => [
      'B bear'  => ['id' => 'B', 'title' => 'B bear',  'value' => 27]
    ],
    'C' => [
      'C Cat'   => ['id' => 'C', 'title' => 'C Cat',   'value' => 10]
    ],
  ];
  */

  // Gather elements

  $output = keyi ($input, 'value', true);

  /*
  [
    '10' => [
      ['id' => 'A', 'title' => 'A apple', 'value' => 10],
      ['id' => 'B', 'title' => 'B bear',  'value' => 27],
    ],
    '27' => [
      ['id' => 'C', 'title' => 'C Cat',   'value' => 10],
    ]
  ];
  */
```

### `dig ($array, $key = false, $deep = 1)`

[](#dig-array-key--false-deep--1)

Dig value from array

```
  $input = [
    'A' => [
      'id' => 'A',
      'A apple' => [
        'value' => 10
      ]
    ],
    'B' => [
      'id' => 'B',
      'B bear' => [
        'value' => 27
      ]
    ],
    'C' => [
      'id' => 'C',
      'C Cat' => [
        'value' => 10
      ]
    ],
  ];

  // Dig value from array

  $output = dig ($input, 'id');

  /*
  [
    0 => 'A',
    1 => 'B',
    2 => 'C',
  ];
  */

  // Dig deeply

  $output = dig ($input, 'value', 2);

  /*
  [
    0 => 10,
    1 => 27,
    2 => 10,
  ];
  */
```

### `otoa ($object)`

[](#otoa-object)

Object to array, get array from object values.

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

[](#installation)

Add in your `composer.json` with following require entry:

```
{
  "require": {
    "wake/php-array-kit": "*"
  }
}
```

or using composer:

```
$ composer require wake/php-array-kit:*
```

then run `composer install` or `composer update`.

Feedback
--------

[](#feedback)

Please feel free to open an issue and let me know if there is any thoughts or questions 😃

License
-------

[](#license)

Released under the MIT license

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity53

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 ~340 days

Total

6

Last Release

2540d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7224160511f2f5bc6da7c7291c93c8336ada313c5b13d8d50827f95d75808d1f?d=identicon)[Wake](/maintainers/Wake)

---

Top Contributors

[![wake](https://avatars.githubusercontent.com/u/746821?v=4)](https://github.com/wake "wake (26 commits)")

---

Tags

arraytoolkit

### Embed Badge

![Health badge](/badges/wake-php-array-kit/health.svg)

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

###  Alternatives

[doctrine/collections

PHP Doctrine Collections library that adds additional functionality on top of PHP arrays.

6.0k430.2M1.5k](/packages/doctrine-collections)[symfony/property-access

Provides functions to read and write from/to an object or array using a simple string notation

2.8k317.3M3.2k](/packages/symfony-property-access)[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k430.4M1.7k](/packages/nette-utils)[league/config

Define configuration arrays with strict schemas and access values with dot notation

565335.0M36](/packages/league-config)[cuyz/valinor

Dependency free PHP library that helps to map any input into a strongly-typed structure.

1.5k13.2M174](/packages/cuyz-valinor)[openlss/lib-array2xml

Array2XML conversion library credit to lalit.org

31053.8M53](/packages/openlss-lib-array2xml)

PHPackages © 2026

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