简体   繁体   中英

php validation doesn't work

i have this function, it is supposed work, to validate if two passwords match

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 :)

您发布的代码没有问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM