PHP Operators are small functions that will come in very useful during coding and generally involve maths an example is x=x+1, this will make x (an integer hopefully) increment once, if it is set as nothing it will give an error, if it set as any other data type it will give an error.
Some examples of arithmetic operators are;
CODE | OUTCOME
x=x+2 x has 2 added to it
x=x-2 x has 2 taken from it
x=x*5 x is times'd by 5
x=x/5 x is divided by 5
x++ x is incremented (+1)
x-- x is decremented (-1)
-------------------------------------------------------------------------
Assignment operators are used for assigning a value to a variable, there are many of them to be used.
Some assignment operators are;
CODE | OUTCOME
x=y x becomes the same value as y
x+=y x becomes the value of x+y
x-+y x becomes the value of x-y
x*=y x becomes the value of x*y
x/=y x becomes the value of x/y
x=y+7 x becomes the value of y+7
x=y-7 x becomes the value of y-7
x=y/7 x becomes the value of y/7
x=y*7 x becomes the value of y*7
------------------------------------------------------------------------
Comparison operators are generally used in if statements as a condition and are useful to set conditions.
Some examples of comparison operators are;
CODE | OUTCOME
x==1 (if) x equals 1
x!=1 (if) x is NOT equal to 1
x<>1 (if) x is NOT equal to 1
x>1 (if) x is greater than 1
x<1 (if) x is less than 1
x>= (if) x is greater than or equal to 1
x<= (if) x is less than or equal to 1
similar are logical operators, also used in IF statements or similar, they are;
CODE | OUTCOME
&& AND
|| OR
! NOT
i.e
IF (x==8 && y==7) {};
IF (x==8 || y==7) {};
IF (x!=8 ) {};