Forum : What is the pre/post increment/decrement ?
Brief description  about Online courses   join in Online courses
View Balu  Prasad 's Profile

What is the pre/post increment/decrement ?

post/pre increment/decrement.....
Asked by Balu Prasad | Mar 17, 2010 |  Reply now
Replies (1)
View teacher siliconindia 's Profile
Hi Balu,
To add one to a variable or "increment" use the "++" operator:
$x++; Which is equivalent to $x += 1; or $x = $x + 1;
To subtract 1 from a variable, or "decrement" use the "--" operator:
$x--; Which is equivalent to $x -= 1; or $x = $x - 1;
Mar 17, 2010