采用:
<?php
$array1 = array(0 => 'zero_a', 2 => 'two_a', 3 => 'three_a');
$array2 = array(0 => 'zero_b', 2 => 'two_b', 3 => 'three_b');
foreach(array_combine($array1,$array2) as $key=>$value) {
echo substr($key,0,-2).":".$key." ".$value.".";
//or
//$k = explode("_",$key);
//echo $k[0].":".$key." ".$value.".";
}
?>
也可以对两个以上的数组进行
<?php
$array1 = array(0 => 'zero_a', 2 => 'two_a', 3 => 'three_a');
$array2 = array(0 => 'zero_b', 2 => 'two_b', 3 => 'three_b');
$array3 = array(0 => 'zero_c', 2 => 'two_c', 3 => 'three_c');
//........more array
foreach($array1 as $key=>$value) {
$k = explode("_",$value);
echo $k[0].":".$array1[$key]." ".
$array2[$key]." ".
$array3[$key].". "
//.........more array item concat
;
}
?>