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

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

codeliner/array-reader
======================

PHP ArrayReader

v2.1(7y ago)19276.1k—5.7%59BSD-3-ClausePHPPHP &gt;=7.1

Since Mar 8Pushed 6y ago1 watchersCompare

[ Source](https://github.com/codeliner/array-reader)[ Packagist](https://packagist.org/packages/codeliner/array-reader)[ Docs](https://github.com/codeliner/array-reader)[ RSS](/packages/codeliner-array-reader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (1)Versions (6)Used By (9)

array-reader
============

[](#array-reader)

PHP ArrayReader

[![Build Status](https://camo.githubusercontent.com/e5eb330ff77426d2fb2db73429f98fcf4fa526aa38b2a9a5ce8882c10863c2a2/68747470733a2f2f7472617669732d63692e6f72672f636f64656c696e65722f61727261792d7265616465722e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/codeliner/array-reader)

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

[](#installation)

Installation of codeliner\\array-reader uses composer. For composer documentation, please refer to [getcomposer.org](http://getcomposer.org/). Add following requirement to your composer.json

```
"codeliner/array-reader" : "~2.0"
```

Usage
-----

[](#usage)

You can use the ArrayReader to read single values from a multidimensional array by passing the path to one of the `{type}Value()` methods. Each `{type}Value()` method takes a default value as second argument If the path can not be found in the original array, the default is used as return value.

Example
-------

[](#example)

```
$arrayReader = new ArrayReader(
    array(
        'hash' => array(
            'with' => array(
                'nested' => 'value'
            )
        )
    )
);

echo $arrayReader->stringValue('hash.with.nested'));

//Output: value

$arrayReader = new ArrayReader(
    array(
        'hash' => array(
            'with' => array(
                'nested' => 'value'
            )
        )
    )
);

echo $arrayReader->stringValue('hash.not.existing.path', 'defaultString'));

//Output: defaultString

//If a key in your array contains a dot you escape it in the path with a backslash

$arrayReader = new ArrayReader(
    array(
        'hash' => array(
            'with.dot.key' => array(
                'nested' => 'value'
            )
        )
    )
);

echo $arrayReader->stringValue('hash.with\.dot\.key.nested'));

//Output: value

//If you need to differentiate between a NULL value and a not existing path, you can explicity check if the path exists:

$arrayReader = new ArrayReader(
    array(
        'hash' => array(
            'with' => array(
                'nested' => null
            )
        )
    )
);

if($arrayReader->pathExists('hash.with.nested')) {
    echo "path exists";
}

//Output: path exists
```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community21

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

5

Last Release

2725d ago

Major Versions

v1.2.0 → v2.02018-07-11

PHP version history (2 changes)1.0PHP &gt;=5.3.3

v2.0PHP &gt;=7.1

### Community

Maintainers

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

---

Top Contributors

[![peter279k](https://avatars.githubusercontent.com/u/9021747?v=4)](https://github.com/peter279k "peter279k (1 commits)")[![rdohms](https://avatars.githubusercontent.com/u/94331?v=4)](https://github.com/rdohms "rdohms (1 commits)")[![sandrokeil](https://avatars.githubusercontent.com/u/3597436?v=4)](https://github.com/sandrokeil "sandrokeil (1 commits)")

---

Tags

phputilArrayReader

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[jansenfelipe/utils

Uma simples classe utilitária com métodos que podem salvar sua vida (ou não)

62146.4k10](/packages/jansenfelipe-utils)[swlib/util

Swlib Toolkit

11144.6k3](/packages/swlib-util)

PHPackages © 2026

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