Skip to content

Instantly share code, notes, and snippets.

@piotrpasich
Created December 4, 2013 14:22
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 piotrpasich/7788202 to your computer and use it in GitHub Desktop.
Save piotrpasich/7788202 to your computer and use it in GitHub Desktop.
<?php
$roles = array('ROLE_USER', 'ROLE_ADMIN');
if ( ! in_array('RULE_SUPER_ADMIN', $roles)) {
echo "RULE_SUPER_ADMIN not found\n";
}
$roles = array('ROLE_USER', 'ROLE_ADMIN',true);
if (in_array('RULE_SUPER_ADMIN', $roles)) {
echo "RULE_SUPER_ADMIN found: it is not funny\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment