PHP
[PHP] PHP/operators/increase operator, decrease operator
OOQ
2022. 8. 13. 09:39
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