I have a variable and I just want to add 1 to it. Do I use:
++$variable
or something like that?
Yes.
Ta!
I could've sworn it was $variable++ ...you might want to take a look at the difference between preincrement and postincrement operators!
I could've sworn it was $variable++
No difference when used alone.
Unless you're talking about C++, then pre-increment is usually preferred.
Really? I've almost always used postincrement, no matter what language.
No biggie. As long as it gets incremented right? 😃