ratacibernetica/php-flatten-array
Composer 安装命令:
composer require ratacibernetica/php-flatten-array
包简介
Flatten an array.
README 文档
README
Flatten an array.
Install
composer require ratacibernetica/php-flatten-array
- Expected input:
[ 1, [ 2 ], [[3],[[4]]]];
- Expected output:
[1,2,3,4]
Example Usage:
$multipleArray = [ 1, [ 2 ], [[3],[[4]]]]; $flattener = new ratacibernetica\FlattenArray($multipleArray); $flattenedArray = $flattener->flattened; // equals $flattenedArray, [1,2,3,4]); $otherFlat = $flattener->flattenArray( [1, [2], [3], [[4],[5]]] ); // equals( $otherFlat, [1,2,3,4,5]);
Run tests
Tests are located in the tests folder, and can be run with codeception, like so:
$ codecept run unit
统计信息
- 总下载量: 32
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-03-20