XOR or bit manupulation

From: Date: Sun, 03 Feb 2002 02:25:53 +0000
Subject: XOR or bit manupulation
Groups: php.dev php.doc php.qa 
Request: Send a blank email to php-dev+get-78919@lists.php.net to get a copy of this message
Hi Is there anything that can manipulate a variable bit by bit? If have a variable $x that has to switch between two values. It doesn't matter if it is true or false, 0 and 255 or whatever. Normally the easiest way would be to use xor to have the variable switch between both states but I couldn't find anything like that in the reference. Does PHP support such kind of bit manipulation? Or does anybody know another way to have the variable switch on an easy way? I know that it is possible with several if...thens but I'm looking for an easier and faster way. Thanks for your answers and help. Mika

« previous php.dev (#78919) next »