I need help to create array inside array. I have this 2 variables containing array:
$first = [12, 23, 34];
$second = [32, 21, 43];
I want to create an array from that two arrays. The form of array that I want is:
$combine = {'name'=>'data1', [[12,32], [23,21], [34,43]]}
I have tried this one:
$first = [12, 23, 34];
$second = [32, 21, 43];
$comb=[];
foreach($first as $key){
foreach($second as $row){
$comb[]=$key;
$comb[]=$row;
}
}
$combine=['name'=>'data1', 'color'=> '#299662', $comb];
and it result in this array: