PHP OPERATORS


 

PHP OPERATORS
What is PHP? Why should we use PHP? What is the PHP OperatorsCoding Standard of PHP? PHP Coding Standards

 Arithmetic operators
 Assignment operators
 Comparison operators
 Increment/decrement operators
 Logical operators
 String operators
 Array operators
 Conditional assignment operators

Arithmetic operators

Operators              Name
+                              addition
–                              subtraction
*                             multiplication
%                            modulus
/                              division
**                           exponentiation

Assignment                          Operators
Assignment                          Same Detail
X=y X=y                                  Left operand get value
X+=y X=x+y                            addition
X-=y X=x-y                              subtraction
X*=y X=x*y                              multiply
X/=y X=x/y                               division
X%=y X=x%y                           modulus

Conditional                        operators
?:                                            Ternary
??                                           Null coalescing

PHP Array                  Operators
Operators                   name

+                                     union
==                                    equality
===                                  identity
!=                                     inequality
<>                                    inequality
!==                               Non identity

PHP String 
operators                            name

.                                              concatenation
.=                                            Concatenation assignment
PHP logical                         operators
Name                                   operators
and                                        and
or                                            or
xor                                            xor
and                                           &&
or                                              ||
Not                                               !
PHP increment/decrement operators
name operators

Pre increment ++$x
Post increment $x++
Pre decrement –$x
Post decrement $x–

PHP comparison operators
Name                           operators

Spaceship                           <=>
Less than or equal to <= Greater than equal to >=
Less then                         < Greater then >
Not identical                         !==
Not equal                                <>
Not equal                                 !=
Identical                                ===
equal                                             ==

What is PHP? Why should we use PHP? What is the Coding Standard of PHP? PHP Coding Standards

 

 

Administrators Categories

All the administrators we have talked about above can be ordered into following classes −

Parallel administrators, which take two operands and play out an assortment of math and coherent activities.

The contingent administrator (a ternary administrator), which takes three operands and assesses either the second or third articulation, contingent upon the assessment of the principal articulation.

Task administrators, which dole out an incentive to a variable.

Priority of PHP Operators

Administrator priority decides the gathering of terms in an articulation. This influences how an articulation is assessed. Certain administrators have higher priority than others; for instance, the duplication administrator has higher priority than the expansion administrator −

For instance x = 7 + 3 * 2; Here x is appointed 13, not 20 since administrator * has higher priority than + so it initially get duplicated with 3*2 and afterward includes into 7.

Here administrators with the most noteworthy priority show up at the head of the table, those with the least show up at the base. Inside an articulation, higher priority administrators will be assessed first

Have any Question or Comment?

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

%d bloggers like this: