$num = 10; //this how many times you want something done
$i=0; //this is the starting number.
echo "
"; //this only happend once
while($i<$num) { //this means that for everytime $i(0) is less than $num(10) the following will happen
echo "
$i
"; //what will happen
$i++; //keep this, otherwise $i will just stay at zero, this makes it increase by one.
} //finish the repeating
echo "
"; //this only happens once.
?>