I' ve fallen into endless foreach's.
I got an array:
$array[0] = array( A,B );
$array[1] = array( A,C );
$array[2] = array( B,C );
$array[3] = array( B,E );
$array[4] = array( C,E );
What I need to get is this:
$array[0] = array( A,B,C );
$array[1] = array( A,B,E );
$array[2] = array( A,C,E );
$array[3] = array( B,C,E );
Is there an easy way to accomplish this by a simple function? Also I need to create 4 value arrays of this results above: A,B,C,E etc.
A,E
pair in the first part. Otherwise I see no logic in the way you organize them. @webbiedave No, it is not a cartesian product. It is a permutation list. – kirilloid Apr 6 '12 at 22:46