I'm in over my head, but I think I'm going to get through this one alive.
I need to pull out the value of a vBulletin profile from a form field with multiple checkboxes. They've decide to output this as a binary number which can be decoded.
I've got the the number.
Let's assume it is this: 0101
This tells me that that option0 and option2 have been selected.
The problem I'm having is in the fact that binary goes "backwards". In other words, where I come from, the first item is on theft side. However, in my example binary # (0101) the 1 on the right side represents the first selection option.
My plan was to bust this thing up with an explode and then "decode" the array.
The problem is a I have 11 possible options in my form field. So 0101 is not really exact. 00000000101 would be exact (and what I think I need to achieve this).
So, I need to be able to add the zeros in front of the binary # so that I can loop through them with some kind of reference as to what the first digit means.
Of course, now that I think about it, I could explode each digit into an array and then flip the keys of the array. Hmmmm. I'll do this.
Is there a better way?