Get every combination of multiple arrays that can have multiple options

时间:2015-07-31 20:20:16

标签: php arrays multidimensional-array

I know a similar question has been asked in the past but this one is a bit different. I'm looking to get every variation possible including multiple options from a single array so. I'm really struggling with this and I greatly appreciate any help in it.

$arrayA = array("1","2","3");
$arrayB = array("A","B");

Results should be

1
2
3
12
13
121
123
1A
1B
1C
1A
12A

etc..

so the same value can't be repeated twice but can include others from the same array. The desired output is in the form of an array where it's easy to see what the pulled elements are.

0 个答案:

没有答案