Unary Operators in PHP

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:

  1. Unary plus (+): It is used to convert an operand to a numeric value, and it is denoted by the plus sign (+).
  2. Unary minus (-): It is used to negate an operand and is denoted by the minus sign (-).
  3. Increment (++): It is used to increase the value of an operand by one.
  4. Decrement (–): It is used to decrease the value of an operand by one.
  5. Logical not (!): It is used to reverse the logical value of an operand.
  6. 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

Back to Tutorials

Share this post
[social_warfare]
MS-EXCEL 2003
Worksheet Basics

Get industry recognized certification – Contact us

keyboard_arrow_up