PHPackages                             tebru/multi-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. tebru/multi-array

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

tebru/multi-array
=================

Provides a data structure to ease access to multidimensional arrays in PHP

v0.2.1(10y ago)43.3k↓62.5%1[2 issues](https://github.com/tebru/multi-array/issues)[1 PRs](https://github.com/tebru/multi-array/pulls)MITPHPPHP &gt;=5.4

Since Nov 22Pushed 10y ago2 watchersCompare

[ Source](https://github.com/tebru/multi-array)[ Packagist](https://packagist.org/packages/tebru/multi-array)[ RSS](/packages/tebru-multi-array/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (4)Used By (0)

[![Build Status](https://camo.githubusercontent.com/5e75151fe5c7bb4491a4c7702545fed835ce6769482f965ad42d66b91229d74a/68747470733a2f2f7472617669732d63692e6f72672f74656272752f6d756c74692d61727261792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tebru/multi-array)[![Coverage Status](https://camo.githubusercontent.com/52505bec4a00a4825d155834f28402f88d8783f4df4c6e7894c56ca79a9f03da/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f74656272752f6d756c74692d61727261792f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/tebru/multi-array?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b4d4261d83f915d053af93c63683ef5c96480bb564d5a05249a7170dce7e4337/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f74656272752f6d756c74692d61727261792f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/tebru/multi-array/?branch=master)

MultiArray
==========

[](#multiarray)

This project aims to provide easier access to multidimensional arrays. Json responses were in mind during the creation. The goal is to make it easier to check if keys are set multiple levels deep, and retrieve the value.

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

[](#installation)

```
composer require tebru/multi-array:~0.1

```

Usage
-----

[](#usage)

Create the object by either instantiating it or using the factory. i Pass in a json object or array. An InvalidArgumentException will be thrown if it can't decode the json, or the variable isn't an array.

```
$array = [
    'key' => 'value',
    'key2' => ['nested-key' => 'value2'],
];
$multiArray = new MultiArray($array);
$multiArray = $multiArrayFactory->make($array);

$json = json_encode($array);
$multiArray = new MultiArray($json);
$multiArray = $multiArrayFactory->make($json);

```

From here you can check if a key exists

```
$multiArray->exists('key2.nested-key'); // returns true
$multiArray->exists('key3'); // returns false

```

Get the value of a key

```
$multiArray->get('key2'); // returns ['nested-key' => 'value2']
$multiArray->get('key2.nested-key'); // returns 'value2'
$multiArray->get('key3'); // throws OutOfBoundsException

```

Set the value of a key

```
$multiArray->set('key1', 'value');
$multiArray->set('key2.nested-key', 'value');
$multiArray->set('key2.newKey', 'value');
$multiArray->set('key1.newKey', 'value'); // throws InvalidArgumentException

```

Remove the value of a key

```
$multiArray->remove('key1');
$multiArray->remove('key2.unknown'); // throws OutOfBoundsException

```

We default to delimiting keys by a period `.`, but that can be changed during instantiation

```
$multiArray = new MultiArray($array, ':');
$multiArray = $multiArrayFactory->make($array, '--');

```

You can also access the object like a normal array

```
isset($multiArray['key2.nested-key']);
$multiArray['key2.nested-key'];
$multiArray['key2.nested-key'] = 'value';
unset($multiArray['key2.nested-key']);

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

4005d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1831497?v=4)[Nate Brunette](/maintainers/natebrunette)[@natebrunette](https://github.com/natebrunette)

---

Top Contributors

[![natebrunette](https://avatars.githubusercontent.com/u/1831497?v=4)](https://github.com/natebrunette "natebrunette (14 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[foxxmd/laravel-elasticbeanstalk-cron

Ensure only one Laravel instance is running CRON jobs in an EB environment

62311.8k](/packages/foxxmd-laravel-elasticbeanstalk-cron)

PHPackages © 2026

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