PHPackages                             gajus/marray - 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. gajus/marray

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

gajus/marray
============

More array functions.

122481[3 issues](https://github.com/gajus/marray/issues)PHP

Since Mar 7Pushed 12y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Marray
======

[](#marray)

[![Build Status](https://camo.githubusercontent.com/2b3f22a90baa611918257ed9a621a9eb9e2e671dfdab08fe962c4605aa2ea4df/68747470733a2f2f7472617669732d63692e6f72672f67616a75732f6d61727261792e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/gajus/marray)[![Coverage Status](https://camo.githubusercontent.com/2bba30cd0fe34a7e24b903b9b2bc2c413b17a45344c502a863498c54254e3faa/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f67616a75732f6d61727261792f62616467652e706e67)](https://coveralls.io/r/gajus/marray)

Extension to the already vast [PHP array toolkit](http://ie2.php.net/manual/en/book.array.php).

```
/**
 * Strip-down $input to values where $input key is found among $template values.
 *
 * @throws Gajus\Marray\Exception\InvalidArgumentException If input is not an associative array.
 * @throws Gajus\Marray\Exception\InvalidArgumentException If template is not a list.
 * @throws Gajus\Marray\Exception\InvalidArgumentException If $input does not have all the keys defined in $template.
 * @param array $input
 * @param array $template
 * @return array
 */
array \Gajus\Marray\template ( array $input, array $template )

/**
 * http://php.net/array_intersect recursive implementation.
 *
 * @param array $arr1 The array with master values to check.
 * @param array $arr2 An array to compare values against.
 * @param array ... A variable list of arrays to compare.
 * @return array
 */
array \Gajus\Marray\intersect_recursive ( array $arr1 , array $arr2 [, array $... ] )

/**
 * http://php.net/array_diff_key recursive implementation.
 *
 * @todo Support variadic input.
 * @param array $arr1 The array with master keys to check.
 * @param array $arr2 An array to compare keys against.
 * @return array
 */
array \Gajus\Marray\diff_key_recursive ( array $arr1 , array $arr )

/**
 * http://php.net/array_unique implementation with user callback.
 *
 * @param array The input array.
 * @param callable $value_func Function must return the value used for comparison.
 * @param int $sort_flags
 */
array \Gajus\Marray\uunique ($array, callable $value_func, $sort_flags = \SORT_STRING)

/**
 * http://uk1.php.net/array_walk_recursive implementation that is used to remove nodes from the array.
 *
 * @param array The input array.
 * @param callable $callback Function must return boolean value indicating whether to remove the node.
 * @return array
 */
function walk_recursive_remove (array $array, callable $callback)
```

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b46b18abe058b038c677a9fa4aa6c39de7597196fb72a11add1f11600412a0e5?d=identicon)[gajus](/maintainers/gajus)

---

Top Contributors

[![gajus](https://avatars.githubusercontent.com/u/973543?v=4)](https://github.com/gajus "gajus (17 commits)")

### Embed Badge

![Health badge](/badges/gajus-marray/health.svg)

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

###  Alternatives

[learninglocker/learninglocker

The open source learning record store.

5813.0k](/packages/learninglocker-learninglocker)[clearstream/xml-to-array

Incredibly simple XML to array PHP converter

6738.4k](/packages/clearstream-xml-to-array)[chan-sccp/pami

Asterisk Manager Interface (AMI) client for PHP, event driven, object oriented (Fork)

2954.7k](/packages/chan-sccp-pami)[shkoliar/magento-grid-colors

Magento 2 module for colorizing admin grids. Supports saving of states with the help of grid's bookmarks.

6011.2k](/packages/shkoliar-magento-grid-colors)

PHPackages © 2026

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