In most languages, ++ after the variable means "post-increment" (and -- is post-decrement),
basically it will evaluate the variable before it, and return it's value, increased by one (or decreased for --)
Likewise, ++ before the variable performs a similar operation, but in a different order (pre versus post). In this case, it will increment the variable then return it's value.
For example, in a loop such as that, it will evaluate your $counter, then after evaluation , increase its value by one.
If you used ++$counter, it would increase its value first, then evaluate it to see if the loop should continue.
To elaborate, and steal an example from the PHP manual (http://www.php.net/manual/en/language.operators.increment.php):
<?php
echo "<h3>Postincrement</h3>";
$a = 5;
echo "Should be 5: " . $a++ . "<br />\n";
echo "Should be 6: " . $a . "<br />\n";
echo "<h3>Preincrement</h3>";
$a = 5;
echo "Should be 6: " . ++$a . "<br />\n";
echo "Should be 6: " . $a . "<br />\n";
echo "<h3>Postdecrement</h3>";
$a = 5;
echo "Should be 5: " . $a-- . "<br />\n";
echo "Should be 4: " . $a . "<br />\n";
echo "<h3>Predecrement</h3>";
$a = 5;
echo "Should be 4: " . --$a . "<br />\n";
echo "Should be 4: " . $a . "<br />\n";
?>
Make sense?