What is (^) in php? [duplicate]

-2

I'm doing a comparison of two binary numbers by checking which index from right to left the bits are different. I found a code as soon as it works:

strspn(strrev("1111") ^ strrev("1101"), "
var_dump("aaab" ^ "aaac");
");

This code returns me 1 which is the index of the first bit of the numbers that are different. But I did not understand the "bulhufas" of the code and what this means: (^) . I tried searching the manual and did not find it. To try to figure out what this is, I did this:

strspn(strrev("1111") ^ strrev("1101"), "
var_dump("aaab" ^ "aaac");
");

Only this returns a control character string SOH .

So my question comes down to 3 parts:

  • What is this sign (^) and what exactly does it do?
  • How does that first line of code work?
  • Why this control character return SOH ?
  • asked by anonymous 15.10.2018 / 23:05

    1 answer

    -1

    It is the XOR operator, as can be seen in more detail through this link: link

        
    15.10.2018 / 23:10