0
Multipication table
<?php for ($i= 1; $i <= 9; $i++) { for ($j=1 ;$j <= 9; $j++){ echo $i*$j . " "; } echo "</br>"; } ?> i don get how this work? Why the number didnt increase together ?
2 Answers
0
this is nestead loop. internal loop of j will run each time for outer loop value of i. so when i is 1 j will run from 1 to 9.
i=1,j=1
i=1, j=2
.
.
i=1,j=9
i=2,j=1
....
0
oh maybe i didnt learn yet thanks will check it out