Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/299.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP-从循环制动的问题_Php_Loops - Fatal编程技术网

PHP-从循环制动的问题

PHP-从循环制动的问题,php,loops,Php,Loops,第一个问题:我是不是走错了路 我有困难刹车,从我的为每一个有条件的如果在里面。我写这篇文章只是为了节省CPU时间,但我无法从我的foreach中刹车 我正试图遵守Active Directory严格的密码执行,我不相信有最长的密码。正如我发现一些网站有最大长度的要求 foreach(count_chars($new_password, 1) as $key => $value){//Strength Test Results can be derived from $value if(!c

第一个问题:我是不是走错了路

我有困难刹车,从我的为每一个有条件的如果在里面。我写这篇文章只是为了节省CPU时间,但我无法从我的foreach中刹车

我正试图遵守Active Directory严格的密码执行,我不相信有最长的密码。正如我发现一些网站有最大长度的要求

foreach(count_chars($new_password, 1) as $key => $value){//Strength Test Results can be derived from $value
if(!ctype_upper(chr($key))){$check_upper=1;}//if Upper-case
if(!ctype_lower(chr($key))){$check_lower=1;}//if Lower-case
if(!ctype_digit(chr($key))){$check_digit=1;}//if Numeric
if(!ctype_punct(chr($key))){$check_punct=1;}//if Symbol
if($check_upper + $check_lower + $check_digit + $check_punct>= 3){
    break; 
    }//Save us from checking the entire string 
}

你用错关键词了!它的意思应该是
break

foreach(count_chars($new_password, 1) as $key => $value){//Strength Test Results can be derived from $value
if(!ctype_upper(chr($key))){$check_upper=1;}//if Upper-case
if(!ctype_lower(chr($key))){$check_lower=1;}//if Lower-case
if(!ctype_digit(chr($key))){$check_digit=1;}//if Numeric
if(!ctype_punct(chr($key))){$check_punct=1;}//if Symbol
if($check_upper + $check_lower + $check_digit + $check_punct>= 3){
    break; 
    }//Save us from checking the entire string 
}

很简单:
break

foreach(count_chars($new_password, 1) as $key => $value){//Strength Test Results can be derived from $value
if(!ctype_upper(chr($key))){$check_upper=1;}//if Upper-case
if(!ctype_lower(chr($key))){$check_lower=1;}//if Lower-case
if(!ctype_digit(chr($key))){$check_digit=1;}//if Numeric
if(!ctype_punct(chr($key))){$check_punct=1;}//if Symbol
if($check_upper + $check_lower + $check_digit + $check_punct>= 3){
    break; 
    }//Save us from checking the entire string 
}
刹车是汽车的功能


break
not
brake
你踩错了踏板你的密码车会撞死你的。啊,我在那里重新输入了密码,但没有检查我的拼写“我的错”。那么你的密码拼写正确吗?我不得不说是的。我真的必须专注于一件事,而不是很多。我还更新了PHP、ISS和Fast CGI,重新启动了服务器,同时在另一个领域破坏了代码。这就是为什么我会犯一些错误的原因,至少这都是在发展过程中。