Home  >  Article  >  php教程  >  权限控制方法

权限控制方法

PHP中文网
PHP中文网Original
2016-05-24 09:11:13944browse

跳至

$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 &#39; [&#39; . $value . &#39;:&#39; . ( ( $access & (1 << $key) ) ? &#39;Y&#39; : &#39;N&#39; ). &#39;] &#39;;
	}

                   

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn