Basic Addition Question
Posted: Sun Oct 11, 2009 4:36 pm
What is the difference between $i++ and ++$i when used in a for loop?
Thanks!
Thanks!
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$i = 1;
$x = $i++;
// $x = 1
// $i = 2
$i = 1;
$x = ++$i;
// $x = 2
// $i = 2