728x90
SMALL
#php
#PHP/operators/increase operator, decrease operator
++$a
Returns $a after increasing the value. for example
$a = 1;
echo ++$a;
will output 2.
$a++
After returning $a , increment the value. for example
$a = 1;
echo $a++;
will output 1 and the value of $a will be 2.
--$a
Returns $a after decrementing the value. for example
$a = 1;
echo --$a;
will output 0.
$a--
Decrease the value after returning $a. for example
$a = 1;
echo $a--;
will output 1 and the value of $a will be 0.
alphabet
Alphabets can also be incremented or decremented. for example
$a = a;
echo ++$a;
will output b.
After z is aa, and after zz is aaa.
728x90
LIST
'PHP' 카테고리의 다른 글
[PHP] PHP/operators/logical operators (0) | 2022.08.14 |
---|---|
[PHP] PHP/operators/comparison operators (0) | 2022.08.08 |
[PHP] PHP/operators/arithmetic operators (0) | 2022.08.08 |
[PHP] PHP/operator/assignment operator (0) | 2022.08.04 |
[PHP] How to create PHP/variables/flow variables (variables within variables) (0) | 2022.08.04 |