- Notifications
You must be signed in to change notification settings - Fork0
An array helper for PHP. It includes some useful methods and possibly other features.
License
nabeghe/arrayer-php
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
An array helper for PHP. It includes some useful methods and possibly other features.
Some of the methods from the Arr class of the Laravel framework are also included in this library;however, some of them have been modified.
You can install the package via composer:
composer require nabeghe/arrayer
The main class that includes the useful methods isNabegh\Arrayer\Arr.
useNabeghe\Arrayer\Arrayer;$data1 = ['key_1' =>'value_1','key_3' => ['key_3_1' =>'value_3_1']];$data2 = ['key_2' =>'value_2'];$data3 = ['key_3' => ['key_3_2' =>'value_3_2']];$arrayer =newArrayer();print_r($arrayer->merge($data1,$data2,$data3)->data);/* Array ( [key_1] => value_1 [key_3] => Array ( [key_3_1] => value_3_1 [key_3_2] => value_3_2 ) [key_2] => value_2 ) */
Accepts any value, converts it to an array viaArr::cast, stores it, and returns it viadata property.
It is possible to access the methods of theArr class through theArrayer object as well, with the difference that the main array parameter is no longer present.
Additionally, theArrayAccess andJsonSerializable interfaces have also been implemented onArrayer class.
Licensed under the MIT license, seeLICENSE.md for details.
About
An array helper for PHP. It includes some useful methods and possibly other features.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.