开发者

php validation doesn't work

开发者 https://www.devze.com 2023-02-18 11:15 出处:网络
i have this function, it is supposed work, to validate if two passwords m开发者_开发知识库atch

i have this function, it is supposed work, to validate if two passwords m开发者_开发知识库atch

What is problem with this code?

function validatePasswords($myPassword, $pass2) {
    //if DOESN'T MATCH
    if(strpos($myPassword, ' ') !== false)
    return false;

    //if are valid
    return $myPassword == $pass2 && strlen($myPassword) >= 4;
}

thanks :)


There is no problem with the code you posted.

0

精彩评论

暂无评论...
验证码 换一张
取 消