title: Bitwise comparison in PHP
body: <p>I confess I don't really know what I'm doing! I'm pulling some data from SecondLife and parsing it in PHP. The data is an integer from <a href="http://wiki.secondlife.com/wiki/LlGetRegionFlags" rel="nofollow">llGetRegionFlags</a> which, in my case, returns 1048592</p>
  
  <p>Now I need to do a bitwise comparison in PHP to figure out which flags are true/false. For example 0x00000040 is used for the "block terraform" flag.</p>
  
  <p>The notations are in hex for each flag, and I have an integer to test against, and the <a href="http://php.net/manual/en/language.operators.bitwise.php" rel="nofollow">PHP manual</a> suggests integers and shows examples in binary.</p>
  
  <p>So my question really is, given an integer and some hex flags, how do I go about doing the bitwise comparison in PHP? Brainfried! Thanks in advance</p>