|
gmp_setbitSet bit Description
void gmp_setbit
( resource
&$a
, int $index
[, bool $bit_on = true
] )
Sets bit Parameters
Return ValuesA GMP number resource. Examples
Example #1 gmp_setbit example - 0 index
<?php The above example will output: 2 -> 0b10 3 -> 0b11 Example #2 gmp_setbit example - 1 index
<?php The above example will output: 253 -> 0b11111101 255 -> 0b11111111 Example #3 gmp_setbit example - clearing a bit
<?php The above example will output: 255 -> 0b11111111 254 -> 0b11111110 Notes
See Also
|