PHPackages                             cable8mm/array-flatten - 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. cable8mm/array-flatten

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

cable8mm/array-flatten
======================

Flatten a multi-dimensional array in PHP.

v1.0.1(2y ago)031.5k↓40%2MITPHPPHP ^8.0

Since Mar 1Pushed 2y ago1 watchersCompare

[ Source](https://github.com/cable8mm/array-flatten)[ Packagist](https://packagist.org/packages/cable8mm/array-flatten)[ RSS](/packages/cable8mm-array-flatten/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (2)

Array Flatten
=============

[](#array-flatten)

[![code-style](https://github.com/cable8mm/array-flatten/actions/workflows/code-style.yml/badge.svg)](https://github.com/cable8mm/array-flatten/actions/workflows/code-style.yml)[![run-tests](https://github.com/cable8mm/array-flatten/actions/workflows/run-tests.yml/badge.svg)](https://github.com/cable8mm/array-flatten/actions/workflows/run-tests.yml)[![Packagist Version](https://camo.githubusercontent.com/da70446767e570b7c1695d5fa0a3d36e894ec56269bc2483ad4d13320c8c927c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6361626c65386d6d2f61727261792d666c617474656e)](https://camo.githubusercontent.com/da70446767e570b7c1695d5fa0a3d36e894ec56269bc2483ad4d13320c8c927c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6361626c65386d6d2f61727261792d666c617474656e)[![Packagist Downloads](https://camo.githubusercontent.com/3cad7f615413976204154dc87f25c406ecd01d6187f5fcc1198b4370b786e855/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6361626c65386d6d2f61727261792d666c617474656e)](https://camo.githubusercontent.com/3cad7f615413976204154dc87f25c406ecd01d6187f5fcc1198b4370b786e855/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6361626c65386d6d2f61727261792d666c617474656e)[![Packagist Dependency Version](https://camo.githubusercontent.com/330d75bb75afdf1e66d0890041971ad824e7a8a5fa1234b0f5f5e162cb145aa2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6361626c65386d6d2f61727261792d666c617474656e2f706870)](https://camo.githubusercontent.com/330d75bb75afdf1e66d0890041971ad824e7a8a5fa1234b0f5f5e162cb145aa2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f6361626c65386d6d2f61727261792d666c617474656e2f706870)[![Packagist Stars](https://camo.githubusercontent.com/6bdfbca205009d47413dd012c6bd7dc157fa7468653f0ec76d9290e7b45e80e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f6361626c65386d6d2f61727261792d666c617474656e)](https://camo.githubusercontent.com/6bdfbca205009d47413dd012c6bd7dc157fa7468653f0ec76d9290e7b45e80e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f73746172732f6361626c65386d6d2f61727261792d666c617474656e)[![Packagist License](https://camo.githubusercontent.com/c6776b5a7fb4ec83ba166b4b9a46d9d8f728f2cbd679e4c58e8f0264d85e171a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6361626c65386d6d2f61727261792d666c617474656e)](https://camo.githubusercontent.com/c6776b5a7fb4ec83ba166b4b9a46d9d8f728f2cbd679e4c58e8f0264d85e171a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6361626c65386d6d2f61727261792d666c617474656e)

Flatten nested arrays.

We have provided the API Documentation on the web. For more information, please visit  ❤️

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

[](#installation)

```
composer require cable8mm/array-flatten
```

Usage
-----

[](#usage)

```
use function Cable8mm\ArrayFlatten\array_flatten;

array_flatten([1, [2, [3, [4, [5], 6], 7], 8], 9]);
//=> [1, 2, 3, 4, 5, 6, 7, 8, 9]
```

License
-------

[](#license)

The Array Flatten is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity47

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

Total

2

Last Release

800d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c910c874a0263a18f9f976273054cd45faa3ffbcba7891992f4ab52d0656dd93?d=identicon)[Sam Lee](/maintainers/Sam%20Lee)

---

Top Contributors

[![cable8mm](https://avatars.githubusercontent.com/u/2672043?v=4)](https://github.com/cable8mm "cable8mm (7 commits)")

---

Tags

arrayarray-flattenflattenphp

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[mageplaza/module-gdpr

Magento 2 GDPR Extensions

52333.4k1](/packages/mageplaza-module-gdpr)[prooph/event-store-bus-bridge

Marry CQRS with Event Sourcing

37518.3k11](/packages/prooph-event-store-bus-bridge)[loveorigami/yii2-modal-ajax

A wrapper around Yii2 Bootstrap Modal for using an ActiveForm via AJAX inside

50167.8k2](/packages/loveorigami-yii2-modal-ajax)[proner/phppimaco

Lib para geração de Etiquetas PIMACO

7470.0k](/packages/proner-phppimaco)[yii2mod/collection

Basic collection library

31177.6k5](/packages/yii2mod-collection)[elgentos/magento2-inventory-log

Magento 2 - Inventory Log

3073.8k](/packages/elgentos-magento2-inventory-log)

PHPackages © 2026

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