Ok so, I'm having a slight problem here - it seems like something is
offset somehow, I will show an example:
Using this mask as an example...
define('TMONLY', 0x00800);
and this statement...
if(($hparts[0] & TMONLY) == TMONLY){
echo "THIS SHOULD BE TMONLY<br />";
}
Ok, so then when I run this code, things are being marked on the page
"THIS SHOULD BE TMONLY" when that bit is obviously not set (for
example 601209), what could be going on?
I tried to break it down by creating a test page to make sure the
correct bits are being fed into it....for example....
<?PHP
$test = hexdec(601209);
$headr = substr(sprintf('%032b', $test), 0, -12);
echo $headr;
?>
this outputs 0000 0000 0110 0000 0001 for the last 20 bits - as you
can see, 8 is not set here, but its returning to me as if it were for
some reason. This is happening only for the 1,2,4,6, and 8's that are
set in that bit....i.e..
in binary...any variation of that field where 8 is set should be
setting it to true:
0000 0000 1000 0000 0000
0000 0000 1001 0000 0000
0000 0000 1010 0000 0000
0000 0000 1011 0000 0000
0000 0000 1100 0000 0000
0000 0000 1101 0000 0000
0000 0000 1110 0000 0000
0000 0000 1111 0000 0000
So why would something like the following set it off?
0000 0000 0010 0000 0000
0000 0000 0110 0000 0000
This is really confusing, as it seems like its treating my mask as a 4-bit byte rather than a single bit inside....any help much appreciated, thanks!