Skip to content
This repository has been archived by the owner on May 19, 2021. It is now read-only.
/ pile Public archive

A small helper for fetching multidimensional arrays and objects.

License

Notifications You must be signed in to change notification settings

danielneubert/pile

Repository files navigation

Pile

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.

About

A small helper for fetching multidimensional arrays and objects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages