Try this:
for ($i=0, $k=10; $i<=10 ; $i++, $k--) {
echo "Var " . $i . " is " . $k . "<br>";
}
The two variables $i
and $k
are initialized with 0
and 10
respectively. At the end of each each loop $i
will be incremented by one ($i++
) and $k
decremented by one ($k--
). So $i
will have the values 0, 1, …, 10 and $k
the values 10, 9, …, 0.