The difference between ++ I and I ++ in php. 1. the usage of ++ I (taking a ++ I, i2 as an example) first adds the I value to 1 (that is, ii + 1 ), then assign the variable a (that is, ai), then the final a value is equal to 3, and the I value is equal to 3. Institute
1. usage of ++ I (using a = ++ I, I = 2 as an example)
Add the I value to 1 (that is, I = I + 1) and then assign it to variable a (that is, a = I ),
The final a value is 3, and the I value is 3.
So a = ++ I is equivalent to I = I + 1, a = I
2. I ++ usage (take a = I ++, I = 2 as an example)
First, assign the I value to variable a (that is, a = I), and then add 1 (that is, I = I + 1) to the I value ),
Then, the final a value is 2, and the I value is 3.
So a = I ++ is equivalent to a = I, I = I + 1
3. ++ I and I ++
A = ++ I is equivalent to I ++, a = I
A = I ++ is equivalent to a = I, I ++
4. when ++ I and I ++ are used independently, they are equivalent to I = I + 1.
If a new variable is assigned, ++ I first adds 1 to the I value, and I ++ first assigns I to the new variable.
For example, if a = ++ I, I = 2 is used, add the I value to 1 (that is, I = I + 1 ), then assign the variable a (that is, a = I), the final a value is 3, and the I value is 3. By...