PHP » Operators » ^

Syntax:
expression1 ^ expression2
expression1
First operand.
expression2
Second operand.

Bitwise XOR.

This is the bitwise XOR operator.

Examples

Code:
<?php

$a = 11;
$b = 7;

printf("%b ^ %b = %b", $a, $b, $a ^ $b);

?>
Output:
1011 ^ 111 = 1100
Explanation:

The bitwise XOR operator is used on the numbers 5 and 7.