PHP » Operators » ~

Syntax:
~expression
expression
Value that the bitwise NOT should be applied to.

Bitwise NOT.

This is a bitwise NOT, that changes zeros to ones, and ones to zeros.

Examples

Code:
<?php

$a = 11;

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

?>
Output:
~1011 = 11111111111111111111111111110100
Explanation:

A 32-bit integer is assigned the value 11. It is printed as a binary number together with its corresponding bitwise inverted number.