PHP Array Operators With Example

Array Operators:

The PHP array operators are used to compare arrays.

List of Array Operators:

Operator Name Example Result
+ Union $x + $y Union of $x and $y
== Equality $x == $y True if $x and $y have the same key/value pairs
=== Identity $x === $y True if $x and $y have the same key/value pairs in the same order and of the same types
!= Inequality $x != $y True if $x is not equal to $y
<> Inequality $x <> $y True if $x is not equal to $y
!== Non-identity $x !== $y True if $x is not identical to $y


Example:



Result:

bool(false)
bool(false)
bool(true)
bool(true)
bool(true) 

Read Also: