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

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

ratacibernetica/php-flatten-array
=================================

Flatten an array.

v1.1(9y ago)032MITPHP

Since May 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/ratacibernetica/php-flatten-array)[ Packagist](https://packagist.org/packages/ratacibernetica/php-flatten-array)[ RSS](/packages/ratacibernetica-php-flatten-array/feed)WikiDiscussions master Synced 2d ago

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

php-flatten-array
=================

[](#php-flatten-array)

Flatten an array.

### Install

[](#install)

`composer require ratacibernetica/php-flatten-array`

1. Expected input:

```
[ 1, [ 2 ], [[3],[[4]]]];
```

2. Expected output:

```
[1,2,3,4]
```

### Example Usage:

[](#example-usage)

```
	$multipleArray = [ 1, [ 2 ], [[3],[[4]]]];
        $flattener = new ratacibernetica\FlattenArray($multipleArray);
        $flattenedArray = $flattener->flattened;

        // equals $flattenedArray, [1,2,3,4]);

        $otherFlat = $flattener->flattenArray( [1, [2], [3], [[4],[5]]] );
        // equals( $otherFlat, [1,2,3,4,5]);
```

### Run tests

[](#run-tests)

Tests are located in the `tests` folder, and can be run with [codeception](https://codeception.com), like so:

```
$ codecept run unit
```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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

Unknown

Total

1

Last Release

3330d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/825f802113460db0d6dfcb2f46933d4307e1e702724629b49e43c0433cfcedc2?d=identicon)[ratacibernetica](/maintainers/ratacibernetica)

---

Top Contributors

[![ratacibernetica](https://avatars.githubusercontent.com/u/1541791?v=4)](https://github.com/ratacibernetica "ratacibernetica (2 commits)")

###  Code Quality

TestsCodeception

### Embed Badge

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

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

###  Alternatives

[browner12/helpers

generic helpers

285696.4k7](/packages/browner12-helpers)[illuminated/helper-functions

Laravel-specific and pure PHP Helper Functions.

107593.0k7](/packages/illuminated-helper-functions)[thisisbd/silverstripe-maintenance-mode

SilverStripe Maintenance Mode Module. Allows an administrator to put site in offline mode with 503 status to display a 'Coming Soon', 'Under Construction' or 'Down for Maintenance' Page to regular visitors, whilst allowing a logged in admin user to browse and make changes to the site.

2011.6k](/packages/thisisbd-silverstripe-maintenance-mode)

PHPackages © 2026

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