PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm using the variable $currentpic twice in the same line. At the first occurence I want it to have a value of minus one of its current value, without actually changing the value of it.
Let's say $currentpic equals 5. I want it to generate the following html code
If you decrement the value of $currentpic inline like that, the next reference to it will also contain the decremented value, which is not what you want, right?
No, I don't want that. I'd like it to keep its value. My goal would be to echo a value that is not the value of the variable, but the value of the mathematical expression (x-1) where x is $currentpic.
x equals 5, but (x-1) equals 4.