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

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

eden/array
==========

Autoloading, error and exception handler

4.0.3(9y ago)3419.2k↓11.5%119MITPHPPHP &gt;=5.4.1

Since Oct 6Pushed 9y ago3 watchersCompare

[ Source](https://github.com/Eden-PHP/Array)[ Packagist](https://packagist.org/packages/eden/array)[ Docs](http://eden-php.com)[ RSS](/packages/eden-array/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (7)Used By (19)

[![logo](https://camo.githubusercontent.com/683ba05b2b51f50045c674b19a4f0ceb30702a8ab495623be7c02e07ab226f08/687474703a2f2f6564656e2e6f70656e6f766174652e636f6d2f6173736574732f696d616765732f636c6f75642d736f6369616c2e706e67)](https://camo.githubusercontent.com/683ba05b2b51f50045c674b19a4f0ceb30702a8ab495623be7c02e07ab226f08/687474703a2f2f6564656e2e6f70656e6f766174652e636f6d2f6173736574732f696d616765732f636c6f75642d736f6369616c2e706e67) Eden Array
================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#-eden-array)

[![Build Status](https://camo.githubusercontent.com/4a87db4bf4267e5f4b7b2170053b3b2f2823a72606f49e639230c619d50b513b/68747470733a2f2f6170692e7472617669732d63692e6f72672f4564656e2d5048502f41727261792e706e67)](https://travis-ci.org/Eden-PHP/Array)
=====================================================================================================================================================================================================================================================

[](#)

- [Install](#install)
- [Introduction](#intro)
- [API](#api)
    - [arsort](#arsort)
    - [asort](#asort)
    - [changeKeyCase](#changeKeyCase)
    - [chunk](#chunk)
    - [combine](#combine)
    - [count](#count)
    - [countValues](#countValues)
    - [diff](#diff)
    - [diffAssoc](#diffAssoc)
    - [diffKey](#diffKey)
    - [diffUassoc](#diffUassoc)
    - [diffUkey](#diffUkey)
    - [fill](#fill)
    - [fillKeys](#fillKeys)
    - [filter](#filter)
    - [flip](#flip)
    - [implode](#implode)
    - [inArray](#inArray)
    - [intersect](#intersect)
    - [intersectAssoc](#intersectAssoc)
    - [intersectKey](#intersectKey)
    - [intersectUassoc](#intersectUassoc)
    - [intersectUkey](#intersectUkey)
    - [keys](#keys)
    - [krsort](#krsort)
    - [ksort](#ksort)
    - [map](#map)
    - [merge](#merge)
    - [mergeRecursive](#mergeRecursive)
    - [natcasesort](#natcasesort)
    - [natsort](#natsort)
    - [pad](#pad)
    - [pop](#pop)
    - [push](#push)
    - [reverse](#reverse)
    - [rsort](#rsort)
    - [search](#search)
    - [shift](#shift)
    - [shuffle](#shuffle)
    - [sizeof](#sizeof)
    - [slice](#slice)
    - [sort](#sort)
    - [splice](#splice)
    - [sum](#sum)
    - [uasort](#uasort)
    - [udiff](#udiff)
    - [udiffAssoc](#udiffAssoc)
    - [udiffUassoc](#udiffUassoc)
    - [uintersect](#uintersect)
    - [uintersectAssoc](#uintersectAssoc)
    - [uintersectUassoc](#uintersectUassoc)
    - [uksort](#uksort)
    - [unique](#unique)
    - [unshift](#unshift)
    - [usort](#usort)
    - [values](#values)
    - [walk](#walk)
    - [walkRecursive](#walkRecursive)
- [Contributing](#contributing)

====

Install
-------

[](#install)

`composer install eden/array`

====

Enable Eden
-----------

[](#enable-eden)

The following documentation uses `eden()` in its example reference. Enabling this function requires an extra step as descirbed in this section which is not required if you access this package using the following.

```
Eden_Array_Index::i();

```

When using composer, there is not an easy way to access functions from packages. As a workaround, adding this constant in your code will allow `eden()` to be available after.

```
Eden::DECORATOR;

```

For example:

```
Eden::DECORATOR;

eden()->inspect('Hello World');

```

====

Introduction
------------

[](#introduction)

Chainable array methods. When using multiple PHP array functions in one line, it makes code harder to read. This is because a programmer needs to be trained to read code from inner to outer, rather than traditionally left to right (unless you live in Japan). Eden's data typing are objects that correct this readability problem.

```
array_keys(array_reverse(array_flip(array(4, 5, 6)))); // [6, 5, 4]

```

The above demonstrates that we must read this as `array_flip()`, then `array_reverse()`, followed by `array_keys()` which is inner function first going outwards. The example below shows how using types makes this line easier to read.

```
echo eden('array')->set(4, 5, 6)->flip()->reverse()->keys(); //--> [6, 5, 4]

```

When echoed the array object will automatically convert to a readable json. Eden covers most of the array functions provided by PHP. Below is a list of string methods you can linearly perform.

```
echo eden('array')
	->set(4, 5, 6)
	->flip()
	->reverse()
	->keys(); //--> [6, 5, 4]

```

Expressed vertically as above shows something more pleasing to a developer. Array objects, for the most part, can also be treated as regular arrays as implied below.

```
//instantiate
$array = eden('array')->set(1, 2, 3);

//push in a new value
$array[] = 4;

echo $array[1];  //--> 2

foreach($array as $key => $value) {} //loop through array

```

====

API
---

[](#api)

====

### addslashes

[](#addslashes)

Same as PHP: addslashes

#### Usage

[](#usage)

```
eden('string')->addslashes();

```

#### Example

[](#example)

```
eden('string')->set('Hello')->addslashes();

```

====

### bin2hex

[](#bin2hex)

Same as PHP: bin2hex

#### Usage

[](#usage-1)

```
eden('string')->bin2hex();

```

#### Example

[](#example-1)

```
eden('string')->set('Hello')->bin2hex();

```

====

### chunkSplit

[](#chunksplit)

Same as PHP: chunk\_split

#### Usage

[](#usage-2)

```
eden('string')->chunkSplit();

```

#### Example

[](#example-2)

```
eden('string')->set('Hello')->chunkSplit();

```

====

### convertUudecode

[](#convertuudecode)

Same as PHP: convert\_uudecode

#### Usage

[](#usage-3)

```
eden('string')->convertUudecode();

```

#### Example

[](#example-3)

```
eden('string')->set('Hello')->convertUudecode();

```

====

### convertUuencode

[](#convertuuencode)

Same as PHP: convert\_uuencode

#### Usage

[](#usage-4)

```
eden('string')->convertUuencode();

```

#### Example

[](#example-4)

```
eden('string')->set('Hello')->convertUuencode();

```

====

### countChars

[](#countchars)

Same as PHP: count\_chars

#### Usage

[](#usage-5)

```
eden('string')->countChars();

```

#### Example

[](#example-5)

```
eden('string')->set('Hello')->countChars();

```

====

### crypt

[](#crypt)

Same as PHP: crypt

#### Usage

[](#usage-6)

```
eden('string')->crypt();

```

#### Example

[](#example-6)

```
eden('string')->set('Hello')->crypt();

```

====

### explode

[](#explode)

Same as PHP: explode

#### Usage

[](#usage-7)

```
eden('string')->explode();

```

#### Example

[](#example-7)

```
eden('string')->set('Hello')->explode();

```

====

### hex2bin

[](#hex2bin)

Same as PHP: hex2bin

#### Usage

[](#usage-8)

```
eden('string')->hex2bin();

```

#### Example

[](#example-8)

```
eden('string')->set('Hello')->hex2bin();

```

====

### htmlEntityDecode

[](#htmlentitydecode)

Same as PHP: html\_entity\_decode

#### Usage

[](#usage-9)

```
eden('string')->htmlEntityDecode();

```

#### Example

[](#example-9)

```
eden('string')->set('Hello')->htmlEntityDecode();

```

====

### htmlentities

[](#htmlentities)

Same as PHP: htmlentities

#### Usage

[](#usage-10)

```
eden('string')->htmlentities();

```

#### Example

[](#example-10)

```
eden('string')->set('Hello')->htmlentities();

```

====

### htmlspecialchars

[](#htmlspecialchars)

Same as PHP: htmlspecialchars

#### Usage

[](#usage-11)

```
eden('string')->htmlspecialchars();

```

#### Example

[](#example-11)

```
eden('string')->set('Hello')->htmlspecialchars();

```

====

### htmlspecialcharsDecode

[](#htmlspecialcharsdecode)

Same as PHP: htmlspecialchars\_decode

#### Usage

[](#usage-12)

```
eden('string')->htmlspecialcharsDecode();

```

#### Example

[](#example-12)

```
eden('string')->set('Hello')->htmlspecialcharsDecode();

```

====

### ipTags

[](#iptags)

Same as PHP: strip\_tags

#### Usage

[](#usage-13)

```
eden('string')->ipTags();

```

#### Example

[](#example-13)

```
eden('string')->set('Hello')->ipTags();

```

====

### ipcslashes

[](#ipcslashes)

Same as PHP: stripcslashes

#### Usage

[](#usage-14)

```
eden('string')->ipcslashes();

```

#### Example

[](#example-14)

```
eden('string')->set('Hello')->ipcslashes();

```

====

### ipslashes

[](#ipslashes)

Same as PHP: stripslashes

#### Usage

[](#usage-15)

```
eden('string')->ipslashes();

```

#### Example

[](#example-15)

```
eden('string')->set('Hello')->ipslashes();

```

====

### ireplace

[](#ireplace)

Same as PHP: str\_ireplace

#### Usage

[](#usage-16)

```
eden('string')->ireplace();

```

#### Example

[](#example-16)

```
eden('string')->set('Hello')->ireplace();

```

====

### istr

[](#istr)

Same as PHP: stristr

#### Usage

[](#usage-17)

```
eden('string')->istr();

```

#### Example

[](#example-17)

```
eden('string')->set('Hello')->istr();

```

====

### lcfirst

[](#lcfirst)

Same as PHP: lcfirst

#### Usage

[](#usage-18)

```
eden('string')->lcfirst();

```

#### Example

[](#example-18)

```
eden('string')->set('Hello')->lcfirst();

```

====

### len

[](#len)

Same as PHP: strlen

#### Usage

[](#usage-19)

```
eden('string')->len();

```

#### Example

[](#example-19)

```
eden('string')->set('Hello')->len();

```

====

### ltrim

[](#ltrim)

Same as PHP: ltrim

#### Usage

[](#usage-20)

```
eden('string')->ltrim();

```

#### Example

[](#example-20)

```
eden('string')->set('Hello')->ltrim();

```

====

### md5

[](#md5)

Same as PHP: md5

#### Usage

[](#usage-21)

```
eden('string')->md5();

```

#### Example

[](#example-21)

```
eden('string')->set('Hello')->md5();

```

====

### nl2br

[](#nl2br)

Same as PHP: nl2br

#### Usage

[](#usage-22)

```
eden('string')->nl2br();

```

#### Example

[](#example-22)

```
eden('string')->set('Hello')->nl2br();

```

====

### pad

[](#pad)

Same as PHP: str\_pad

#### Usage

[](#usage-23)

```
eden('string')->pad();

```

#### Example

[](#example-23)

```
eden('string')->set('Hello')->pad();

```

====

### pbrk

[](#pbrk)

Same as PHP: strpbrk

#### Usage

[](#usage-24)

```
eden('string')->pbrk();

```

#### Example

[](#example-24)

```
eden('string')->set('Hello')->pbrk();

```

====

### pos

[](#pos)

Same as PHP: strpos

#### Usage

[](#usage-25)

```
eden('string')->pos();

```

#### Example

[](#example-25)

```
eden('string')->set('Hello')->pos();

```

====

### pregReplace

[](#pregreplace)

Same as PHP: preg\_replace

#### Usage

[](#usage-26)

```
eden('string')->pregReplace();

```

#### Example

[](#example-26)

```
eden('string')->set('Hello')->pregReplace();

```

====

### quotedPrintableDecode

[](#quotedprintabledecode)

Same as PHP: quoted\_printable\_decode

#### Usage

[](#usage-27)

```
eden('string')->quotedPrintableDecode();

```

#### Example

[](#example-27)

```
eden('string')->set('Hello')->quotedPrintableDecode();

```

====

### quotedPrintableEncode

[](#quotedprintableencode)

Same as PHP: quoted\_printable\_encode

#### Usage

[](#usage-28)

```
eden('string')->quotedPrintableEncode();

```

#### Example

[](#example-28)

```
eden('string')->set('Hello')->quotedPrintableEncode();

```

====

### quotemeta

[](#quotemeta)

Same as PHP: quotemeta

#### Usage

[](#usage-29)

```
eden('string')->quotemeta();

```

#### Example

[](#example-29)

```
eden('string')->set('Hello')->quotemeta();

```

====

### repeat

[](#repeat)

Same as PHP: str\_repeat

#### Usage

[](#usage-30)

```
eden('string')->repeat();

```

#### Example

[](#example-30)

```
eden('string')->set('Hello')->repeat();

```

====

### replace

[](#replace)

Same as PHP: str\_replace

#### Usage

[](#usage-31)

```
eden('string')->replace();

```

#### Example

[](#example-31)

```
eden('string')->set('Hello')->replace();

```

====

### rev

[](#rev)

Same as PHP: strrev

#### Usage

[](#usage-32)

```
eden('string')->rev();

```

#### Example

[](#example-32)

```
eden('string')->set('Hello')->rev();

```

====

### rot13

[](#rot13)

Same as PHP: str\_rot13

#### Usage

[](#usage-33)

```
eden('string')->rot13();

```

#### Example

[](#example-33)

```
eden('string')->set('Hello')->rot13();

```

====

### rtrim

[](#rtrim)

Same as PHP: rtrim

#### Usage

[](#usage-34)

```
eden('string')->rtrim();

```

#### Example

[](#example-34)

```
eden('string')->set('Hello')->rtrim();

```

====

### sha1

[](#sha1)

Same as PHP: sha1

#### Usage

[](#usage-35)

```
eden('string')->sha1();

```

#### Example

[](#example-35)

```
eden('string')->set('Hello')->sha1();

```

====

### shuffle

[](#shuffle)

Same as PHP: str\_shuffle

#### Usage

[](#usage-36)

```
eden('string')->shuffle();

```

#### Example

[](#example-36)

```
eden('string')->set('Hello')->shuffle();

```

====

### sprintf

[](#sprintf)

Same as PHP: sprintf

#### Usage

[](#usage-37)

```
eden('string')->sprintf();

```

#### Example

[](#example-37)

```
eden('string')->set('Hello')->sprintf();

```

====

### str

[](#str)

Same as PHP: strstr

#### Usage

[](#usage-38)

```
eden('string')->str();

```

#### Example

[](#example-38)

```
eden('string')->set('Hello')->str();

```

====

### substr

[](#substr)

Same as PHP: substr

#### Usage

[](#usage-39)

```
eden('string')->substr();

```

#### Example

[](#example-39)

```
eden('string')->set('Hello')->substr();

```

====

### substrCompare

[](#substrcompare)

Same as PHP: substr\_compare

#### Usage

[](#usage-40)

```
eden('string')->substrCompare();

```

#### Example

[](#example-40)

```
eden('string')->set('Hello')->substrCompare();

```

====

### substrCount

[](#substrcount)

Same as PHP: substr\_count

#### Usage

[](#usage-41)

```
eden('string')->substrCount();

```

#### Example

[](#example-41)

```
eden('string')->set('Hello')->substrCount();

```

====

### substrReplace

[](#substrreplace)

Same as PHP: substr\_replace

#### Usage

[](#usage-42)

```
eden('string')->substrReplace();

```

#### Example

[](#example-42)

```
eden('string')->set('Hello')->substrReplace();

```

====

### tok

[](#tok)

Same as PHP: strtok

#### Usage

[](#usage-43)

```
eden('string')->tok();

```

#### Example

[](#example-43)

```
eden('string')->set('Hello')->tok();

```

====

### tolower

[](#tolower)

Same as PHP: strtolower

#### Usage

[](#usage-44)

```
eden('string')->tolower();

```

#### Example

[](#example-44)

```
eden('string')->set('Hello')->tolower();

```

====

### toupper

[](#toupper)

Same as PHP: strtoupper

#### Usage

[](#usage-45)

```
eden('string')->toupper();

```

#### Example

[](#example-45)

```
eden('string')->set('Hello')->toupper();

```

====

### tr

[](#tr)

Same as PHP: strtr

#### Usage

[](#usage-46)

```
eden('string')->tr();

```

#### Example

[](#example-46)

```
eden('string')->set('Hello')->tr();

```

====

### trim

[](#trim)

Same as PHP: trim

#### Usage

[](#usage-47)

```
eden('string')->trim();

```

#### Example

[](#example-47)

```
eden('string')->set('Hello')->trim();

```

====

### ucfirst

[](#ucfirst)

Same as PHP: ucfirst

#### Usage

[](#usage-48)

```
eden('string')->ucfirst();

```

#### Example

[](#example-48)

```
eden('string')->set('Hello')->ucfirst();

```

====

### ucwords

[](#ucwords)

Same as PHP: ucwords

#### Usage

[](#usage-49)

```
eden('string')->ucwords();

```

#### Example

[](#example-49)

```
eden('string')->set('Hello')->ucwords();

```

====

### vsprintf

[](#vsprintf)

Same as PHP: vsprintf

#### Usage

[](#usage-50)

```
eden('string')->vsprintf();

```

#### Example

[](#example-50)

```
eden('string')->set('Hello')->vsprintf();

```

====

### wordwrap

[](#wordwrap)

Same as PHP: wordwrap

#### Usage

[](#usage-51)

```
eden('string')->wordwrap();

```

#### Example

[](#example-51)

```
eden('string')->set('Hello')->wordwrap();

```

====

\#Contributing to Eden

Contributions to *Eden* are following the Github work flow. Please read up before contributing.

\##Setting up your machine with the Eden repository and your fork

1. Fork the repository
2. Fire up your local terminal create a new branch from the `v4` branch of your fork with a branch name describing what your changes are. Possible branch name types:
    - bugfix
    - feature
    - improvement
3. Make your changes. Always make sure to sign-off (-s) on all commits made (git commit -s -m "Commit message")

\##Making pull requests

1. Please ensure to run `phpunit` before making a pull request.
2. Push your code to your remote forked version.
3. Go back to your forked version on GitHub and submit a pull request.
4. An Eden developer will review your code and merge it in when it has been classified as suitable.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity62

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

Every ~58 days

Recently: every ~72 days

Total

6

Last Release

3586d ago

PHP version history (2 changes)v3PHP &gt;=5.3.1

4.0.1PHP &gt;=5.4.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/120378?v=4)[Christian Blanquera](/maintainers/cblanquera)[@cblanquera](https://github.com/cblanquera)

---

Top Contributors

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

---

Tags

libraryeden

### Embed Badge

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

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

###  Alternatives

[league/iso3166

ISO 3166-1 PHP Library

70036.3M116](/packages/league-iso3166)[dekor/php-array-table

PHP Library for printing associative arrays as text table (similar to mysql terminal console)

296.6M2](/packages/dekor-php-array-table)[eden/core

Eden Core component full of secret sauce

14415.0k34](/packages/eden-core)

PHPackages © 2026

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