PHP Operators

Add Tool

PHP Operators list


To play with PHP, PHP Operators play an important role. If you do not understand about PHP Operators, You would not be able to learn PHP Professionally. So follow the below PHP Operators list

Arithmetic Operators

Operator Description Example Relust
+ Addition x=2x+2 4
- Subtraction x=25-x 3
* Multiplication x=4x*5 20
/ Division 15/5 5/2 32.5
% Modulus (division remainder) 5%2 10%8 10%2 120
++ Increment x=5 x++ x=6
-- Decrement x=5 x-- x=4

Assignment Operators

The basic assignment operator in PHP is "=". It means that the left operand gets set to the value of the expression on the right. That is, the value of "$x = 5" is 5.

Operator Example Is The Same As
= x=y x=y
+= x+=y x=x+y
-= x-=y x=x-y
*= x*=y x=x*y
/= x/=y x=x/y
.= x.= x=x.y
% x%=y x=x%y

Comparison Operators

Operator Description Example
== is equal to 5==8 returns false
!= is not equal 5!=8 returns true
<> is not equal 5<>8 returns true
> is greater than 5>8 returns false
< is less than 5<8 returns true
>= is greater than or equal to 5>=8 returns false
<= is less than or equal to 5<=8 returns true

Logical Operators

Operator Description Example
&& and x=6y=3(x<10 && y>1) returns true
|| or x=6y=3(x==5 || y==5) returns false
! not x=6y=3!(x==y) returns true

Other PHP Operators

  • Bitwise Operators
  • Error Control Operators
  • Execution Operators
  • Incrementing/Decrementing Operators
  • String Operators
  • Array Operators
  • Type Operators

Tags: PHP Operators, php not equal, Logical Operators, Comparison Operators, Assignment Operators, Arithmetic Operators
Payza

About Masum Billah

PHP Operators list 1stWebSuite website seo tool is a free website ranking tool site provides a lot of on page and off page seo useful tools for you. On this site, we have a large number of website ranking tools


SIGN UP TO GET UPDATE TO YOUR INBOX




Discuss about: PHP Operators


adf.ly