$x = "01101010";
$y = "01011001";
echo "x = " . $x . "<br />";
$result = ~bindec($y);
echo "~y = " . decbin($result) . "<br />";
$result = bindec($x) & ~bindec($y);
echo "result = " . decbin($result);
/*
run:
x = 01101010
~y = 11111111111111111111111110100110
result = 100010
*/