- array_map: documentation ( source)
- print_r: documentation ( source)
<?php
$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', array_map(null, $first, $second)];
print_r($combine);