What is ( ) in php?

Asked

Viewed 92 times

-2

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

strspn(strrev("1111") ^ strrev("1101"), "\0");

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

var_dump("aaab" ^ "aaac");

Only it returns a "string" of control character SOH.

So my question boils down to three parts:

  1. What is this sign ( ) and what it does exactly?
  2. How that first line of code works?
  3. Because this return in control character SOH?

1 answer

-1


Browser other questions tagged

You are not signed in. Login or sign up in order to post.