Bitwise operation giving wrong results

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have the following code as a test:
<?php
$a = $_GET['a'];
$b = $_GET['b'];
echo  $a . " & " . $b . " = ";
$out = $a & $b;
echo $out;
//echo 15 & 2;
?>

if I set a to 15 and b to 2 in the URL like so:

test.php?a=15&b=2

it outputs zero as the answer. When I run the hard-coded '&' operation (the
commented out echo), it returns 2. I'm stumped.
-- 
--Zootboy

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux