Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unknownrori/php-easy-array
https://github.com/unknownrori/php-easy-array
Last synced: about 4 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/unknownrori/php-easy-array
- Owner: UnknownRori
- License: mit
- Created: 2022-02-25T02:45:22.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-02-27T23:58:25.000Z (over 2 years ago)
- Last Synced: 2023-07-16T04:16:32.734Z (over 1 year ago)
- Language: PHP
- Size: 20.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Easy Array
### Overview
`\UnknownRori\EasyArray\EasyArray` is a lightweight helper class that can make your array manipulation logic readable.
### Feature
- find
- last
- length
- get
- key
- isNull
- pop
- map
- split
- remove
- push
- merge
- mergeRecursive
- fill
- filter
- reverse
- unique
- exist
- insertKey
- insertVal
- limit
- save### Installation
`Composer require unknownrori/easyarray`
### Usage
Creating new Collection
$array = new EasyArray([1, 2, 3])
Map the collection
$article = new EasyArray([
"article" => "Lorem ipsum",
"slug" => "Lorem",
"timestamp" => date_timestamp_get(date_create()),
]);$article->map(function ($name) {
return strtoupper($name);
});$modifiedArticle = $article->getData();
or using helper function
$array = EasyArr([1, 2, 3]);