第k位置0/置1
$t = 11;
var_dump($t &~ (1 << 3));//置0
var_dump($t | (1 << 2));//置1
// $t &~ (1 << K)
// $t | (1 << K)
第k位置0/置1
$t = 11;
var_dump($t &~ (1 << 3));//置0
var_dump($t | (1 << 2));//置1
// $t &~ (1 << K)
// $t | (1 << K)
转载于:https://my.oschina.net/u/2539883/blog/798703