Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An array helper for PHP. It includes some useful methods and possibly other features.

License

NotificationsYou must be signed in to change notification settings

nabeghe/arrayer-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.


🫡 Usage

🚀 Installation

You can install the package via composer:

composer require nabeghe/arrayer

Arr Class

The main class that includes the useful methods isNabegh\Arrayer\Arr.

Example:

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    ) */

Arrayer Class

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.


📖 License

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

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp