Another solution
<?php
$a = array('a', 'b', 'c', 'd', 'e', 'g');
$b = array('1', '2');
$count_a = count($a);
$count_b = count($b);
for($i=0;$i<$count_a;) {
for($j=0;$j<$count_b;$j++, $i++) {
$result[$i] = $a[$i]."-".$b[$j];
}
print_r($result);
unset($result);
}
But if you want them all in one array
<?php
$a = array('a', 'b', 'c', 'd', 'e', 'g');
$b = array('1', '2');
$count_a = count($a);
$count_b = count($b);
for($i=0;$i<$count_a;) {
for($j=0;$j<$count_b;$j++, $i++) {
$result[$i] = $a[$i]."-".$b[$j];
}
}
print_r($result);