How to get all combinations
| From: | Steen Rabol | Date: | Sat, 18 May 2002 15:08:46 +0000 |
| Subject: | How to get all combinations | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-13854@lists.php.net to get a copy of this message | ||
Hi
I have 6 arrays with data and would like to have all possible
combinations
Eg.
$a1 = array(1,2);
$a2 = array(3,4);
$a3 = array(5,6);
$a4 = array(7,8);
$a5 = array(9,10);
$a6 = array(11,12);
the result should then be a new array like this:
[0] = 1,3,5,7,9,11
[1] = 1,4,5,7,9,11
[2] = 1,6,5,7,9,11
etc....
I know I end up with A LOT, but I need it ;-)
Any hints?
Thanks in advance.
Steen