I'm doing some multiplication tables I've already done one with for
worst I do with while
and do while
but I do not get the same result the for
is this
<?php
for($t=8; $t<=10; $t++)
{
echo "<h3> Tabla del $t </h3>";
// generamos la tabla
for($i=8; $i<=12; $i++)
{
echo "$t x $i = ".($t*$i) . "<br/>";
}
}
?>
With while
worse the same thing does not come out
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
<?php
$t=8;
$i=8;
while($t<=10){
echo "<h3> Tabla del $t </h3>";
$t++;
while($i<=12){
echo "$t x $i = ".($t*$i) . "<br/>";
$i++;
}
}
What can be my mistake?