Home >Backend Development >PHP Tutorial >php中表单验证 == 与===

php中表单验证 == 与===

WBOY
WBOYOriginal
2016-06-23 14:21:03880browse

 各位有没有出现过===可以通过,==反而出现错误的情况?

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 "*";
}
}
?>

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


回复讨论(解决方案)

elseif (!(password)===(cpassword)) {




$呢???

elseif (!(password)===(cpassword)) {




$呢???
好眼力!

谢谢大神帮助,小菜鸟膜拜!

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