PHPackages                             openlss/func-mda - 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. openlss/func-mda

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

openlss/func-mda
================

MDA (Multi Dimensional Array) access helpers for PHP

0.0.11(12y ago)447.2k↓22.6%10LGPL-3.0+PHPPHP &gt;=5.3.2

Since Mar 23Pushed 12y ago1 watchersCompare

[ Source](https://github.com/nullivex/func-mda)[ Packagist](https://packagist.org/packages/openlss/func-mda)[ Docs](http://openlss.org)[ RSS](/packages/openlss-func-mda/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (13)Used By (10)

openlss/func-mda
================

[](#openlssfunc-mda)

MDA (Multi Dimensional Array) access helpers for PHP

Usage
-----

[](#usage)

```
$array = array('test'=>array('test2'=>array('test3'=>'value')));

//get a key
$val = mda_get($array,'test.test2.test3'); //returns 'value'

//set a key
mda_set($array,'test.test2.test3','newvalue');

//add a key
mda_add($array,'test.test2.test4','value3');

//get the added key
$val = mda_get($array,'test.test2.test4.0'); //return 'value3'
```

Reference
---------

[](#reference)

### Keys (Paths)

[](#keys-paths)

MDA keys are used in every function. Sometimes they are referred to as "paths" or "path"

- Dotted notation
- Notation: mda\_get($arr,'index1.index2.index3.index4.0')
- Array: $arr\['index1'\]\['index2'\]\['index3'\]\['index4'\]\[0\]
- Argument notation
- Notation: mda\_get($arr,'index1','index2','index3','index4','0')
- Array: $arr\['index1'\]\['index2'\]\['index3'\]\['index4'\]\[0\]
- Mixed Notation
- Notation: mda\_get($arr,'index1.index2.index3','index4','0')
- Array: $arr\['index1'\]\['index2'\]\['index3'\]\['index4'\]\[0\]

### (mixed) mda\_get(&amp;$arr,$path=null)

[](#mixed-mda_getarrpathnull)

Returns the key from $arr

### (mixed) mda\_set(&amp;$arr,$path=null)

[](#mixed-mda_setarrpathnull)

All of the set functions take the value as the last argument Example

```
mda_set($arr,'index1','index2','index3.index4','value');
```

### (mixed) mda\_add(&amp;$arr,$path=null)

[](#mixed-mda_addarrpathnull)

Same as set except it adds the value as an anonymous index

```
mda_add($arr,'index1.index2','value');
//is the same as
$arr['index1']['index2'][] = 'value';
```

### (bool) mda\_del(&amp;$arr,$path=null)

[](#bool-mda_delarrpathnull)

Delete a path from array

### (mixed) mda\_del\_value(&amp;$arr,$path=null)

[](#mixed-mda_del_valuearrpathnull)

This will delete all values from a path

```
$arr['index'][0] = 'value';
$arr['index'][1] = 'value';
mda_del_value($arr,'index','value');
$count = count($arr['index']); //returns 0
```

### (bool) mda\_exists\_value(&amp;$arr,$path=null)

[](#bool-mda_exists_valuearrpathnull)

This will check if a value exists in a path, same as mda\_del\_value()

### (bool) mda\_exists(&amp;$arr,$path)

[](#bool-mda_existsarrpath)

Checks if a path exists

### (array) mda\_flatten(&amp;$arr,$keyname)

[](#array-mda_flattenarrkeyname)

NOTE: this does not take a path it takes a keyname

- use mda\_get to find the lowest possible path and pass that
- to this functions eg: $arr = mda\_flatten(mda\_get($arr,'path1.path2.path3'),'row\_id);

### (string) implodei($join,$arr=array())

[](#string-implodeijoinarrarray)

Same prototype as PHPs implode with the enhanced functionality that it will take $join as an array If $join is a string it will pass directly to PHPs implode which is faster Example

```
$array = array(1,2,3,4,5);
$join = array('/','.',',');
$str = implodei($join,$array); //returns 1/2.3,4,5
```

NOTE: the last member of the array gets repeated

### (mixed) mda\_shift($arr)

[](#mixed-mda_shiftarr)

NOTE: THIS WILL NOT INCREASE THE ARRAYS POINTER (DOES NOT FUNCTION LIKE ARRAY\_SHIFT) Use this to shift anonymous arrays only it does not reference the original array Otherwise its the same as PHPs array\_shift()

### (array) mda\_merge($arr,$arr\[,$arr...\])

[](#array-mda_mergearrarrarr)

Will recursively merge arrays similar to array\_merge DOES NOT function like array\_merge\_recursive which is wrong

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity33

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 87.5% 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 ~17 days

Recently: every ~38 days

Total

11

Last Release

4635d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/83c8e9d55e3ebafb0621a441a51af8f551f61a274fde5400459a29cc320b7b75?d=identicon)[nullivex](/maintainers/nullivex)

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

---

Top Contributors

[![nullivex](https://avatars.githubusercontent.com/u/2321375?v=4)](https://github.com/nullivex "nullivex (21 commits)")[![Spudz76](https://avatars.githubusercontent.com/u/2391234?v=4)](https://github.com/Spudz76 "Spudz76 (2 commits)")[![doyjo](https://avatars.githubusercontent.com/u/3947855?v=4)](https://github.com/doyjo "doyjo (1 commits)")

---

Tags

arraymulti-dimensional arrayarray helper

### Embed Badge

![Health badge](/badges/openlss-func-mda/health.svg)

```
[![Health](https://phpackages.com/badges/openlss-func-mda/health.svg)](https://phpackages.com/packages/openlss-func-mda)
```

###  Alternatives

[doctrine/collections

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

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

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

2.8k295.3M2.5k](/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.1k394.3M1.5k](/packages/nette-utils)[league/config

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

564302.2M24](/packages/league-config)[cuyz/valinor

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

1.5k9.2M108](/packages/cuyz-valinor)[openlss/lib-array2xml

Array2XML conversion library credit to lalit.org

31052.5M47](/packages/openlss-lib-array2xml)

PHPackages © 2026

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