Actually, you're exactly right.
I started using Xor to toggle, and stopped using binary representations, and everything is working perfectly.
What threw me off tho, is that if I took '0011', and ANDed it with '0010', the result was perfectly correct.
It was only Xor that wasn't working correctly.
I've modified the masks to stop using '0001', '0010', '0100', etc., to instead just use '1 <<0', '1 << 1', '1 << 2', and am performing operations on the ASCII numbers, and, as I said, things are working perfectly.
Thanks for all the help from everyone.
My next question is, is there a way to get PHP to treat binary strings as binary?
I don't really care, since it's working fine, but am curious if there is a way.
Thanks again,
-9mm-