Re: [PHP] Re: Binary mah

2004-06-10 Thread Justin Patrin
Knightking wrote: On Thu, 10 Jun 2004 20:08:08 -0700, Justin Patrin <[EMAIL PROTECTED]> wrote: Mark wrote: [snip] I'm not sure what's wrong with the code you have, but for the 4-digit one you have: $packed = 4-bit var with ABCD encoded in it $a = $packed & 1; $b = $packed & 2; $c = $packed &

Re: [PHP] Re: Binary mah

2004-06-10 Thread Knightking
On Thu, 10 Jun 2004 20:08:08 -0700, Justin Patrin <[EMAIL PROTECTED]> wrote: Mark wrote: [snip] I'm not sure what's wrong with the code you have, but for the 4-digit one you have: $packed = 4-bit var with ABCD encoded in it $a = $packed & 1; $b = $packed & 2; $c = $packed & 4; $d = $packed &

[PHP] Re: Binary mah

2004-06-10 Thread Justin Patrin
Mark wrote: Hey gang, I've got a complex algorithm that I'm trying to work out. I'm trying to store and retrieve a set of switches in a decimal representation of a binary number. I have four checkboxes, call them A, B, C, and D. They can be represented by a (decimal) number from 0 to 15 in binary (