Wrong output, I put a valid password and it does not work

0

Return: string 'password invalid, only letters and accepted numbers' (length = 55)

class Validapass
{
    public function setValidapass($pass)
    {
        if (strlen($pass)<1)
            return 'escreva a password'; 
        else 
            if(!preg_match('/^[0-9a-z]$/i',$pass))
                return 'password invalida, apenas letras e são numeros aceites';
        else 
            return $pass;
    }
}
    
asked by anonymous 23.04.2018 / 11:10

0 answers