let's say that i have the following array:
data[size] = Array('s', 'm');
data[color] = Array('blue', 'red');
I need a function that outputs me the following array
variations[] = Array('s', 'blue');
variations[] = Array('s', 'red');
variations[] = Array('m', 'blue');
variations[] = Array('m', 'red');
The function must work also on arrays like:
data[size] = Array('s', 'm', 'l');
data[color] = Array('blue', 'red');
data[version] = Array('run', 'walk');
It should give an array like
variations[] = Array('s', 'blue', 'run');
variations[] = Array('s', 'blue', 'walk');
variations[] = Array('s', 'red', 'run');
variations[] = Array('s', 'red', 'walk');
And so on ...
How can i implement it?
p.s.: if there is a specific name for this problem let me know so i'll edit the question title for future use