Account
Categories

Equality Operator(==)


Definition:

The symbol of this operator is ==.

If you use this operator in the program, it first matches the key and value of the first array with the other array.

If the values match, it returns true; otherwise, it returns false as output.

Syntax:

$array1 == $array2

Example:

<?php

$array1 = array("a" => "pen", "b" => "copy");
$array2 = array("b" => "copy", "a" => "Apen");
var_dump($array1 == $array2);

?>

Output:

bool(true)