Adds two operands. For example, $a + $b
results in the sum of $a
and $b
.
Subtracts the second operand from the first. For example, $a - $b
results in the difference between $a
and $b
.
Multiplies two operands. For example, $a * $b
results in the product of $a
and $b
.
Divides the first operand by the second. For example, $a / $b
results in the quotient of $a
divided by $b
.
Returns the remainder of the division of the first operand by the second. For example, $a % $b
results in the remainder of $a
divided by $b
.
Raises the first operand to the power of the second operand. For example, $a ** $b
results in $a
raised to the power of $b
.
<?php
$a = 10;
$b = 2;
echo $a + $b; // Outputs: 12
echo $a - $b; // Outputs: 8
echo $a * $b; // Outputs: 20
echo $a / $b; // Outputs: 5
echo $a % $b; // Outputs: 0
echo $a ** $b; // Outputs: 100
?>
Console Output:
12
8
20
5
0
100
Assigns the right operand to the left operand. For example, $a = $b
assigns the value of $b
to $a
.
Adds the right operand to the left operand and assigns the result to the left operand. For example, $a += $b
is equivalent to $a = $a + $b
.
Subtracts the right operand from the left operand and assigns the result to the left operand. For example, $a -= $b
is equivalent to $a = $a - $b
.
Multiplies the right operand with the left operand and assigns the result to the left operand. For example, $a *= $b
is equivalent to $a = $a * $b
.
Divides the left operand by the right operand and assigns the result to the left operand. For example, $a /= $b
is equivalent to $a = $a / $b
.
Takes modulus using two operands and assigns the result to the left operand. For example, $a %= $b
is equivalent to $a = $a % $b
.
<?php
$a = 10;
$b = 5;
$a += $b; // $a = 15
$a -= $b; // $a = 10
$a *= $b; // $a = 50
$a /= $b; // $a = 10
$a %= $b; // $a = 0
?>
Console Output:
15
10
50
10
0
Checks if two operands are equal. Returns true if they are equal. For example, $a == $b
.
Checks if two operands are equal and of the same type. Returns true if they are identical. For example, $a === $b
.
Checks if two operands are not equal. Returns true if they are not equal. For example, $a != $b
.
Checks if two operands are not identical. Returns true if they are not identical. For example, $a !== $b
.
Checks if the left operand is greater than the right operand. Returns true if it is. For example, $a > $b
.
Checks if the left operand is less than the right operand. Returns true if it is. For example, $a < $b
.
<?php
$a = 10;
$b = 20;
var_dump($a == $b); // bool(false)
var_dump($a === $b); // bool(false)
var_dump($a != $b); // bool(true)
var_dump($a !== $b); // bool(true)
var_dump($a < $b); // bool(true)
var_dump($a > $b); // bool(false)
?>
Console Output:
bool(false)
bool(false)
bool(true)
bool(true)
bool(true)
bool(false)
Returns true if both operands are true. For example, $a && $b
.
Returns true if either of the operands is true. For example, $a || $b
.
Returns true if the operand is false. For example, !$a
.
Returns true if both operands are true. This is a lower precedence version of &&
. For example, $a and $b
.
Returns true if either of the operands is true. This is a lower precedence version of ||
. For example, $a or $b
.
Returns true if either of the operands is true, but not both. For example, $a xor $b
.
<?php
$a = true;
$b = false;
var_dump($a && $b); // bool(false)
var_dump($a || $b); // bool(true)
var_dump(!$a); // bool(false)
var_dump($a and $b); // bool(false)
var_dump($a or $b); // bool(true)
var_dump($a xor $b); // bool(true)
?>
Console Output:
bool(false)
bool(true)
bool(false)
bool(false)
bool(true)
bool(true)
Joins two strings together. For example, $a . $b
concatenates $a
and $b
.
Appends the right operand to the left operand and assigns the result to the left operand. For example, $a .= $b
is equivalent to $a = $a . $b
.
<?php
$a = "Hello";
$b = "World";
echo $a . " " . $b; // Outputs: Hello World
$a .= " PHP";
echo $a; // Outputs: Hello PHP
?>
Console Output:
Hello World
Hello PHP
Increases an integer value by one. For example, ++$a
or $a++
.
Decreases an integer value by one. For example, --$a
or $a--
.
<?php
$a = 5;
echo ++$a; // Outputs: 6
echo $a++; // Outputs: 6
echo $a; // Outputs: 7
echo --$a; // Outputs: 6
echo $a--; // Outputs: 6
echo $a; // Outputs: 5
?>
Console Output:
6
6
7
6
6
5
Combines two arrays. For example, $a + $b
returns the union of $a
and $b
.
Checks if two arrays have the same key/value pairs. For example, $a == $b
.
Checks if two arrays have the same key/value pairs in the same order and of the same types. For example, $a === $b
.
Checks if two arrays are not equal. For example, $a != $b
.
Checks if two arrays are not identical. For example, $a !== $b
.
<?php
$a = array("a" => "red", "b" => "green");
$b = array("c" => "blue", "d" => "yellow");
$c = $a + $b; // Union of $a and $b
var_dump($c);
var_dump($a == $b); // bool(false)
var_dump($a === $b); // bool(false)
var_dump($a != $b); // bool(true)
var_dump($a !== $b); // bool(true)
?>
Console Output:
array(4) { ["a"]=> string(3) "red" ["b"]=> string(5) "green" ["c"]=> string(4) "blue" ["d"]=> string(6) "yellow" }
bool(false)
bool(false)
bool(true)
bool(true)
Newsletter
Subscribe to our newsletter for weekly updates and promotions.
Wiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWiki E-Learning
E-LearningComputer Science and EngineeringMathematicsNatural SciencesSocial SciencesBusiness and ManagementHumanitiesHealth and MedicineEngineeringWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWikiCode
Programming LanguagesWeb DevelopmentMobile App DevelopmentData Science and Machine LearningDatabase ManagementDevOps and Cloud ComputingSoftware EngineeringCybersecurityGame DevelopmentWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki News
World NewsPolitics NewsBusiness NewsTechnology NewsHealth NewsScience NewsSports NewsEntertainment NewsEducation NewsWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterWiki Tools
JPEG/PNG Size ReductionPDF Size CompressionPDF Password RemoverSign PDFPower Point to PDFPDF to Power PointJPEG to PDF ConverterPDF to JPEG ConverterWord to PDF ConverterCompany
About usCareersPressCompany
About usCareersPressCompany
About usCareersPressLegal
TermsPrivacyContactAds PoliciesLegal
TermsPrivacyContactAds PoliciesLegal
TermsPrivacyContactAds PoliciesCompany
About usCareersPressCompany
About usCareersPressCompany
About usCareersPressLegal
TermsPrivacyContactAds PoliciesLegal
TermsPrivacyContactAds PoliciesLegal
TermsPrivacyContactAds PoliciesLegal
TermsPrivacyContactAds PoliciesAds Policies