使用PHP从多个数组项生成组合

时间:2018-08-31 18:13:00

标签: php multidimensional-array combinations

我正在开发一项功能,该功能需要从多个数组项生成组合,例如:

array_one('Size:S', 'Size:M');
array_two('Color:Red', 'Color:Yellow');
array_three('Brand:Hugo','Brand:Boss');

And expected combination should be like below:
Combination_one: Size:S,Color:Red,Brand:Hugo
Combination_two: Size:S,Color:Red,Brand:Boss
Combination_three: Size:S,Color:Yellow,Brand:Hugo
Combination_four: Size:S,Color:Yellow,Brand:Boss

Combination_five: Size:M,Color:Red,Brand:Hugo
Combination_six: Size:M,Color:Red,Brand:Boss
Combination_seven: Size:M,Color:Yellow,Brand:Hugo
Combination_eight: Size:M,Color:Yellow,Brand:Boss

如何使用PHP做到这一点?

0 个答案:

没有答案