i have 2 arrays:
$arr1= ['A','B','C'];
$arr2=[1, 2, 3];
what i want to achieve is something like this:
-----------------
| A | A | A | A |
-----------------
| 1 | 1 | 1 | 1 |
-----------------
| B | B | B | B |
-----------------
| 2 | 2 | 2 | 2 |
-----------------
| C | C | C | C |
-----------------
| 3 | 3 | 3 | 3 |
-----------------
and this is what i've tried: `
<?php
$arr1= ['A','B','C'];
$arr2=[1, 2, 3];
$combine = array_combine($arr1, $arr2);
echo "<table>\n";
foreach ( $combine as $i => $a) {
echo "<tr>\n";
for ($j=0; $j < 4 ; $j++) {
if ( $a % 4 == 0) {
echo "</tr>\n <tr>\n";
}
echo "<th>$i</th>\n";
echo "<td>$a</td>\n";
}
echo "</tr>\n";
}
echo "</table>\n";
?>
`
the result isn't like what i'm expecting.
any help will be greatly appreciated.