权限控制方法-PHP源码
跳至
$count = intval(2147483649) > 0 ? 64 : 32;
$rules = range(1,$count);
$allows = array_rand($rules, rand(2,$count));
$access = 0;
foreach ($allows as $value) {
$access |= 1 << array_search($value, $rules);
}
foreach ($rules as $key => $value) {
echo ' [' . $value . ':' . ( ( $access & (1 << $key) ) ? 'Y' : 'N' ). '] ';
}
/phpyy/49350.htmlwww.phpzy.comtrue/phpyy/49350.htmlTechArticle权限控制方法-PHP源码 跳至 $count = intval(2147483649) > 0 ? 64 : 32;$rules = range(1,$count);$allows = array_rand($rules, rand(2,$count));$access = 0;foreach ($allows as $value) {$access |= 1 $value) {echo [ . $value . : . ( ( $ac...
PHP之友评论