Download the PHP package kohkimakimoto/earray without Composer
On this page you can find all versions of the php package kohkimakimoto/earray. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kohkimakimoto/earray
More information about kohkimakimoto/earray
Files in kohkimakimoto/earray
Package earray
Short Description EArray is a small PHP class to provide convenient ways to access a PHP array.
License Apache License 2.0
Homepage https://github.com/kohkimakimoto/EArray
Informations about the package earray
EArray
EArray is a small PHP class to provide convenient ways to access a PHP array.
- Convenient accessing to a nested array.
- You can use a default value when you try to get a value of array.
- You can use this object as a normal array (Implementing
ArrayAccess
,Iterator
andCountable
interfase). - It has some convenient methods for array:
each
,filter
,sort
. - You can register custom methods to array.
It aims to remove code that checks array key existence. Especially for a nested array. Do you hate the code like the below?
You can write same things using EArray object.
Requirement
PHP5.3 or later.
Installation
You can use composer installation.
Make composer.json
file like the following.
And run composer install command.
Usage
- Basic operations
- Convenient methods
- each
- filter
- sort
- Registering a custom method
Basic operations
You can use get
, set
, exists
and delete
methods.
And you can use a delimiter (default /
) for accessing nested array values.
You can change the default delimiter.
Convenient methods
each
filter
sort
Registering a custom method
You can register custom methods to array.
License
Apache License 2.0