neubert/pile

This package is abandoned and no longer maintained. No replacement package was suggested.

A small helper for fetching multidimensional arrays and objects.

2.1.0 2019-02-26 05:53 UTC

This package is auto-updated.

Last update: 2021-05-26 11:18:57 UTC


README

Version Build Status

A small helper for fetching multidimensional arrays and objects.

Pile for PHP can return a value of a multidimensional array or object (or mixed). When the searched value can not be found (due to not existing keys for example) Pile will return null.

Installation

Composer

The preffered way getting Pile is requireing it via composer:

composer require neubert/pile

Download

If you'd like to download Pile to your project you can click here:

Download Pile v2.1.0 (latest)

Example

<?php

use Neubert\Pile;

// sample array
$foo = (object) [
    'key-1' => [
        'key-2' => [
            'key-3' => 'bar'
        ]
    ]
];

// echos 'bar'
echo Pile::find($foo, 'key-1', 'key-2', 'key-3');

License

Pile is released under the MIT License. See the bundled LICENSE file for details.