On Tuesday 13 June 2006 12:18, David Tulloh wrote: > The example starting values > $existing = 181; # = 10110101 > $new = 92; # = 01011100 > $mask = 15; # = 00001111 > > Get the bits that will be changed > $changing = $new & $mask; # = 12 = 00001100 > > Get the bits that won't be changed > $staying = $existing & ~$mask; # = 176 = 10110000 > > Combine them together > $result = $changing ^ $staying; # = 188 = 10111100 > > > David [snip] Thank you very much, I appreciate it! Niels -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php