Operators in PHP

Advertisements

Print Output in PHP For Loop in PHP

Operators in PHP

Operators is a symbol which is used to perform operations on operands. Here you can see very simple example of operator

Example

$num=4+5;

In the above example, + is the binary + operator, 4 and 5 are operands and $num is variable.

PHP divides the operators in the following groups:

  • Arithmetic Operators
  • Comparison Operators
  • Bitwise Operators
  • Logical Operators
  • String Operators
  • Incrementing/Decrementing Operators
  • Array Operators
  • Assignment Operators

Operators in php

OperatorsAdditional InformationAssociativity
clone newclone and newnon-associative
[array()left
**arithmeticright
++ -- ~ (int) (float) (string) (array) (object) (bool) @increment/decrement and typesright
instanceoftypesnon-associative
!logical (negation)right
* / %arithmeticleft
+ - .arithmetic and string concatenationleft
<< >>bitwise (shift)left
< <= > >=comparisonnon-associative
== != === !== <>comparisonnon-associative
&bitwise ANDleft
^bitwise XORleft
|bitwise ORleft
&&logical ANDleft
||logical ORleft
?:ternaryleft
= += -= *= **= /= .= %= &= |= ^= <<= >>= =>assignmentright
andlogicalleft
xorlogicalleft
orlogicalleft
,many uses (comma)left

Print Output in PHP For Loop in PHP

Google Advertisment

Buy This Ad Space @$20 per Month, Ad Size 600X200 Contact on: hitesh.xc@gmail.com or 9999595223

Magenet is best Adsense Alternative here we earn $2 for single link, Here we get links ads. Magenet

For Projects 9999595223

Google Advertisements


Buy Websites 9999595223

Buy College Projects with Documentation Contact on whatsapp 9999595223. Contact on: hitesh.xc@gmail.com or 9999595223 Try this Keyword C++ Programs

Advertisements