S
S
Sergey Pugovkin2015-06-19 14:14:59
PHP
Sergey Pugovkin, 2015-06-19 14:14:59

Get all possible combinations from one element of each array. How?

Given multiple arrays:

$a = ['q', 'w'];
$c = ['z', 'x', 'u'];
$b = ['m', 'h'];
...

It is required to find all possible combinations of these arrays. Those. get something like this:
$z = [
  [	// первая комбинация
    'a' => 'q',
    'b' => 'z',
    'c' => 'm',
  ],
  [	// вторая комбинация
    'a' => 'w',
    'b' => 'z',
    'c' => 'm',
  ],
  [	// третья комбинация
    'a' => 'q',
    'b' => 'x',
    'c' => 'm',
  ],
  ...
];

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SilentFl, 2015-06-19
@Driver86

like this

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question