Do you find this snippet useful? Then share it with your friends or colleagues. This will help us to make our free web tools better.
its very simple
if($flags & 1) { // if bit 1 is set in returned number ($flags) }
Example:
<?php function hasStaticType($num, $type) { return ($num & $type) ? true : false; } $value = 1153; if(hasStaticType($value, 1)){ echo '1 is set'; } else { echo '1 is not set'; }