PHP Operators

PHP Operators In Hindi

PHP

PHP Operators In Hindi:- PHP Operators Ka Istemal Variable Ko operate Karne Ke Liye Kiya Jata Hain And PHP Main Koi Types Ke Operators Hote Hain |

  • Arithmetic operators
  • Assignment operators
  • Comparison operators
  • Increment/Decrement operators
  • Logical operators
  • String operators
  • Array operators
  • Conditional assignment operators

Operators In PHP In Hindi

Contents

Waise To Har Programming Language Main Operators Ka Istemal Kiya Hain Lekin PHP Main Bas Kuch Difference Ke Sath Operators Ka Istemal Hota Hain |

PHP Arithmetic operators in Hindi

Arithmetic Operators Ka Istemal numeric values Ko arithmetical operations Ke Sath Istemal Kiya Hain – such as addition, subtraction, multiplication etc.

OperatorNameExampleResult
+Addition$x + $ySum of $x and $y
Subtraction$x – $yDifference of $x and $y
*Multiplication$x * $yProduct of $x and $y
/Division$x / $yQuotient of $x and $y
%Modulus$x % $yRemainder of $x divided by $y
**Exponentiation$x ** $yResult of raising $x to the $y’th power

Example:

<?php
$x = 10;
$y = 20;

  echo $x + $y; 
  echo "<br>";
  echo $x - $y;
  echo "<br>";
  echo $x * $y;
  echo "<br>";
  echo $x / $y;
  echo "<br>";
  echo $x % $y;
  echo "<br>";
  echo $x ** $y;

?>

Output:

30
-10
200
0.5
10
1.0E+20

PHP Assignment operators in Hindi

Assignment Operators Ka Ham Variable Main Value Assign Karne Ke Liye Istemal karte Hain |

AssignmentSame as… Description
x = yx = yThe left operand gets set to the value of the expression on the right
x += yx = x + yAddition
x -= yx = x – ySubtraction
x *= yx = x * yMultiplication
x /= yx = x / yDivision
x %= yx = x % yModulus

Example:

<?php

$x = 10;
$y = 20;

  echo $x = $y; 
  echo "<br>";
  echo $x = $x + $y;
  echo "<br>";
  echo $x = $x - $y;
  echo "<br>";
  echo $x = $x * $y;
  echo "<br>";
  echo $x = $x / $y;
  echo "<br>";
  echo $x = $x % $y;
  echo "<br>";


?>

Output:

20
40
20
400
20
0

PHP Comparison operators in Hindi

Comparison Operators Ka Istemal Two Values Ko Compare Karne Ke Liye Kiya Jata Hain – ( Number , String ) |

OperatorNameExampleResult
==Equal$x == $yReturns true if $x is equal to $y
===Identical$x === $yReturns true if $x is equal to $y
!=Not equal$x != $yReturns true if $x is not equal to $y
<>Not equal$x <> $yReturns true if $x is not equal to $y
!==Not identical$x !== $yReturns true if $x is not equal to $y, or Ye Same Type Ke Nhi Hain
>Greater than$x > $yReturns true if $x is greater than $y
<Less than$x < $yReturns true if $x is less than $y
>=Greater than or equal to$x >= $yReturns true if $x is greater than or equal to $y
<=Less than or equal to$x <= $yReturns true if $x is less than or equal to $y
<=>Spaceship$x <=> $y

Is Comparison Operators Ko Ham Next If Else If-else Part Main Dekhne Wale Hain |

PHP Increment/Decrement operators in Hindi

PHP increment operatos ka istemal variable ki value ko increment karne ke liye Istemal Kiya Jata Hain |

PHP Decrement operatos ka istemal variable ki value ko Decrement karne ke liye Istemal Kiya Jata Hain |

OperatorNameDescription
++$xPre-incrementIncrements $x by one, then returns $x
$x++Post-incrementReturns $x, then increments $x by one
–$xPre-decrementDecrements $x by one, then returns $x
$x–Post-decrementReturns $x, then decrements $x by one

Example:

<?php

$x = 10;

  echo ++$x; 
  echo "<br>";
  echo $x++;
  echo "<br>";
  echo --$x;
  echo "<br>";
  echo $x--;

?>

Output:

11
11
11
11

PHP Logical Operators in Hindi

PHP Logical Operatos Ka Istemal Conditional Statements Ko Combine Karne Ke Liye Kiya Jata Hain |

OperatorNameExample Result
andAnd$x and $yTrue if both $x and $y are true
orOr$x or $yTrue if either $x or $y is true
xorXor$x xor $yTrue if either $x or $y is true, but not both
&&And$x && $yTrue if both $x and $y are true
||Or$x || $yTrue if either $x or $y is true
!Not!$xTrue if $x is not true

Is Logical Operators Ko Ham Next If Else If-else Part Main Dekhne Wale Hain |

PHP String Operators in Hindi

PHP Main Strings Ke Liye Two Operators Keval Design Kiye Hain Jo Niche Diye Gaye Hain |

OperatorNameExample Result
.Concatenation$txt1 . $txt2Concatenation of $txt1 and $txt2
.=Concatenation assignment$txt1 .= $txt2Appends $txt2 to $txt1

Example:

<?php

$x = "Master";
$y = "Programing";

echo $x.$y; 
echo "<br>";

echo $x.=$y; 
echo "<br>";

?>

Output:

MasterPrograming
MasterPrograming

PHP Array Operators in Hindi

PHP Array Operators Ka Istemal Arrays Ko Compare Karne Ke Liye Kiya Jata Hain |

OperatorNameExampleResult
+Union$x + $yUnion of $x and $y
==Equality$x == $yReturns true if $x and $y have the same key/value pairs
===Identity$x === $yReturns true if $x and $y have the same key/value pairs in the same order and of the same types
!=Inequality$x != $yReturns true if $x is not equal to $y
<>Inequality$x <> $yReturns true if $x is not equal to $y
!==Non-identity$x !== $yReturns true if $x is not identical to $y

Is Array Operators Ko Ham Next If Else If-else Part Main Dekhne Wale Hain |

Also Read:

Leave a Reply

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