ashrafakl/array-container
Composer 安装命令:
composer require ashrafakl/array-container
包简介
PHP array class same as javascript array class
README 文档
README
PHP array class behave like javascript array class
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist ashrafakl/array-container "~1.0.0"
or add
"ashrafakl/array-container": "~1.0.0"
to the required section of your composer.json file.
Usage
Chained method together in a single statement
<?php use ashrafakl\tools\arrays\ArrayContainer; (new ArrayContainer([1, 2, 3, 4, 5, 6, 7, 8, 9, 10])) ->map(function ($val) { return pow(2, $val); }) ->filter(function ($val) { return $val > 70; }) ->order(function ($list) { array_multisort($list, SORT_DESC, SORT_REGULAR); return $list; }) ->unshift(5, 9) ->forEach(function ($value, $index) { echo "{$index}|{$value}" . PHP_EOL; });
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: mit
- 更新时间: 2021-03-14