I want combining each values from two arrays to single array, and have a code like this,
$k = 'a,b';
$db = '01,02,03,04,05';
$dbe = explode(",", $db);
$lenght = count($dbe);
$kdata = explode(",", $k);
$dbdata = explode(",", $db);
if(sizeof($kdata) > sizeof($dbdata)){
$length = count($kdata);
}else{
$length = count($dbdata);
}
for($i=0; $i<$length; $i++)
{
foreach( $kdata as $p => $kop)
{
echo $kop.$dbdata[$p]. ",";
}
}
and get result ;
a01,b02,a01,b02,a01,b02,a01,b02,a01,b02,
but the result not i expected, the result i want like this :
a01, a02, a03, a04, a05, b01, b02, b03, b04, b05,
how do i resolve this code to get result that i want.