Bit manipulation (newbie)
| From: | Karina S | Date: | Fri, 25 Apr 2003 18:41:01 +0000 |
| Subject: | Bit manipulation (newbie) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-145303@lists.php.net to get a copy of this message | ||
Hi,
I want to store user errors. I want to store it as a bit. For example if
user write wrong email it sets the 2.bit to 1 and if the user write wrong
password set the 3. bit to 1. Is it any good way to set and get the bit
values in php?
Now I use :
Write: code = code + 2; code = code + 4; //wrong email and wrong password
Read: if (code == 2 || code == 6) //wrong eamil
But it is not a nice sollution if I have 6-8 bit.
Any idea?
Thanks!