How to mix arrays and get all the options?

There are a few arrays:
$color = ['blue', 'green','red'];
$size = ['L', 'M','XL'];
$some = ['some1', 'some2', 'some3'];
Such arrays can be many. Every once in a while.
How to mix and get the output all the possible options of the form:
$target = [
1 = > [
'color' => 'blue',
'size' => 'XL',
'some' => 'some1',
],
2 = > [
'color' => 'red',
'size' => 'XL',
'some' => 'some1',
],
and so on
].
In General, the primary purpose is to generate trading suggestions in the store. The dress can be different colors, size...
June 14th 19 at 20:16
2 answers
June 14th 19 at 20:18
Solution
Type in Google "php cartesian product".
June 14th 19 at 20:20
The input - tree output - combinations.
The recursive function.

Find more questions by tags PHP