lucianmariusadam / multicombinator
generate all combinations of multiple arrays
Installs: 24 160
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 1
Open Issues: 1
Requires
- php: >=5.3.0
This package is not auto-updated.
Last update: 2024-04-13 15:39:26 UTC
README
Generates all combination of multiple arrays. Can be used as an iterator using methods like next(), rewind().
Given two arrays, the following code:
$lists = [ 'a' => [ 'A', 'B', 'C' ], 'b' => [ 'A', 'B', 'C' ] ]
$c = new MultiCombinator( $lists ); print_r( $c->getAll() );
prints an array containing the following combinations: A A A B A C
B A B B B C
C A C B C C