I have the following array with 2 elements:
$attribute_metric = array(2)
{
[0]=>
array(2) {
[0]=>
string(5) "white"
[1]=>
string(6) " Black"
}
[1]=>
array(3) {
[0]=>
string(1) "S"
[1]=>
string(2) " L"
[2]=>
string(2) " M"
}
}
and I want to concatenate its elements in a way where I get one array that has 6 elements in which every element should look like this
[option_value] => Array(
[0] => Array(
[value] => white
)
[1] => Array(
[value] => S
)
)
I have tried the following but I still can't get close to what I want to achieve:
$final_attribute_metric = array();
foreach ($attribute_metric[0] as $first_attribute) {
foreach ($attribute_metric[1] as $second_attribute) {
$final_attribute_metric[] = [$first_attribute,$second_attribute];
}
}