Skip to content

Instantly share code, notes, and snippets.

@nhc
Created July 16, 2010 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nhc/478029 to your computer and use it in GitHub Desktop.
Save nhc/478029 to your computer and use it in GitHub Desktop.
<?php
//** Give this user access to kListOne and kListTwo
$iUser1 = kNew; // sets to 1
$iUser1 |= kListOne; // sets to 3
$iUser1 |= kListTwo; // sets to 7
//** Give this user access to kListTwo and k3rdPartyOptIn
$iUser2 = kNew; //sets to 1
$iUser2 |= kListTwo; //sets to 5
$iUser2 |= k3rdPartyOptIn; //sets to 13
//** TESTS
echo( $iUser1 & kListOne ) ? 'yes' : 'no'; //outputs 'yes'
echo( $iUser1 & kListTwo ) ? 'yes' : 'no'; //outputs 'yes'
echo( $iUser2 & kListOne ) ? 'yes' : 'no'; //outputs 'no'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment