lucianmariusadam/multicombinator

generate all combinations of multiple arrays

v1.0.2 2015-09-18 15:03 UTC

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