i want to combine 6 indexed array by matching them by keys then insert the value into my tables how can i do it?
[typeSex] => Array
(
[0] => broiler
[1] => layer
)
[noheads] => Array
(
[0] => 123
[1] => 321
)
[origin] => Array
(
[0] => asd
[1] => sda
[2] =>
[3] =>
)
[live] => Array
(
[0] => 123
[1] => 222
)
[carcass] => Array
(
[0] => 312
[1] => 341
[2] =>
[3] =>
)
[totalcarcass] => Array
(
[0] => 231
[1] => 321
[2] =>
[3] =>
)
i can combine only two arrays here's the code that i got in another question
$typeSex = //the typeSex array;
$noheads = //the noheads array;
$temp_array = array();
foreach($typeSex as $k => $v){
if(array_key_exists($k, $noheads)){
$temp_array[$k] = array($v, $noheads[$k]);
}
}
please help me with this, thanks.