lunkkun/permutations-generator
Composer 安装命令:
composer require lunkkun/permutations-generator
包简介
A PHP Generator that generates all possible permutations for a given array of values.
README 文档
README
Summary
A PHP Generator that generates all possible permutations for a given array of values.
Important note
I've optimized the code for performance. Therefore, the order in which the permutations are generated, might differ from what you might expect. To get the permutations in ascending order, you can reverse() every result you get from the generator.
Installation
With composer:
composer require lunkkun/permutations-generator
Usage
<?php $array = range(0, 2); $generator = new \Lunkkun\PermutationsGenerator\PermutationsGenerator($array); foreach ($generator as $permutation) { print_r($permutation); }
License
PHP Permutations Generator is open-sourced software licensed under the MIT license.
统计信息
- 总下载量: 120
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-28