Unary Operators in PHP
In PHP, Unary operators are operators that work on only one operand. There are several Unary operators available in PHP, including:
- Unary plus (+): It is used to convert an operand to a numeric value, and it is denoted by the plus sign (+).
- Unary minus (-): It is used to negate an operand and is denoted by the minus sign (-).
- Increment (++): It is used to increase the value of an operand by one.
- Decrement (–): It is used to decrease the value of an operand by one.
- Logical not (!): It is used to reverse the logical value of an operand.
- Bitwise not (~): It is used to invert the bits of an operand.
These operators are often used in PHP programs to perform various operations such as arithmetic, logical, and bitwise operations.
Apply for PHP Certification!
https://www.vskills.in/certification/certified-php-developer