Home  >  Article  >  Backend Development  >  php中表单印证 == 与===

php中表单印证 == 与===

WBOY
WBOYOriginal
2016-06-13 12:38:31875browse

php中表单验证 == 与===
 各位有没有出现过===可以通过,==反而出现错误的情况?

if (empty($password) || empty($cpassword)) {
die ("No password Submitted");
}
elseif ((strlen($password)15)) {
die("Invalid password length address");
}
elseif (!(strlen(password) == (strlen(cpassword)))) {
die("Passwords do not match!!!");
}
elseif (!(password)===(cpassword)) {
die("Passwords do not match!");
}
else{
for ($i=0; $i  echo "*";
}
}
?>

为什么我的密码在==判断时出现错误,删除掉这个判断,却可以通过?

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