Originally posted by AstroTeg
Sgarissta - I've tested with his code and a simple decbin just needs to be added. Oddly enough, it works and PHP makes the transition from string to decimal ok (although I don't know if I would trust it).
A simplier approach might to keep everything as decimal until you need to do output:
(feels like an idiot)
I wrote that reply off the hip, just did some testing locally, and you are correct, it did the string->dec conversion correctly.
I've played quite a bit with the bitwise stuff, and i learned pretty quickly to explicitly store the numbers NOT as strings, much easier to go bug hunting anyway. 🙂