PHP » Operators » ++

Syntax:
$var++
++$var
var
Variable to increment.

Incrementation.

This operator is a fast way to increment a variable by one step. The variable value can be used at the same time it is incremented. If the operator is placed before the variable, the expression evaluates to the value after incrementation. If it is placed after the variable, it is the value before incrementation.

Examples

Code:
<?php

$a = 10;
print $a++ . " " . $a;

print "<br>";

$b = 10;
print ++$b . " " . $b;

?>
Output:
10 11
11 11
Explanation:

This code demonstrates the difference the placement of the operator makes.