Organizational Research By

Surprising Reserch Topic

how o Check password length in php?



asked Sep 13, 2013 in PHP by ashish singh
edited Sep 12, 2013
0 votes
29 views



Related Hot Questions

1 Answer

0 votes
Check password length in php
 
I have written function to check password length in php
 
$password="checkpassword";
 
 
$passwordCheck=passwordLength($passwod);
 
 
function passwordLength($pwd)
{
    $pwdlen=strlen($pwd);//calculate length of password using strlen function
 
 
      if($pwdlen<=4) //if length of password is less than 4 then password is too short.
      {
         return "Password too short!";
      }
    else if ($pwdlen>16) //if length of password is greater than 16 then password is too Long.
   {
         return "Password too Long!";
     }
} 
 
 
?>
answered Sep 13, 2013 by ashish singh
edited Sep 12, 2013

...