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
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^8
This package is auto-updated.
Last update: 2021-05-26 11:18:57 UTC
README
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:
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.