Basically what was said above but for instance if you wanted to write out a 5x table it'd be something like..
PHP Code:
for($i=1;$i<11;i++)
{
echo "5 x " . $i . " = " . 5*$i . "<br />";
}//For loop
$i = 1;
while($i<11)
{
echo "5 x " . $i . " = " . 5*$i . "<br />";
$i++;
}//While Loop
Thats basically it, same as javascript and most other languages.