👩💻 Join our community of thousands of amazing developers!
Incrementing and decrementing a variable can be accomplished with C-style pre- and post-operators. The pre-operators return the value after it as been incremented or decremented, post- return the value before. Let’s take a look at incrementing first: $i = 1; echo ++$i; // outputs 2 echo $i++; // also outputs......