Welcome aboard! We are happy you are here and wish you good net-raft!
<!DOCTYPE html>
<html lang="en-US">
<head>
</head>
<body>
<?php
$password = "your password";
if( strlen($password) < 8 ) {
$error .= "Password too short! ";
}
if( strlen($password) > 20 ) {
$error .= "Password too long! ";
}
if( !preg_match("#[0-9]+#", $password) ) {
$error .= "Password must include at least one number! ";
}
if( !preg_match("#[a-z]+#", $password) ) {
$error .= "Password must include at least one letter! ";
}
if( !preg_match("#[A-Z]+#", $password) ) {
$error .= "Password must include at least one CAPS! ";
}
if( !preg_match("#\W+#", $password) ) {
$error .= "Password must include at least one symbol! ";
}
if($error){
echo $error;
} else {
echo "Your password is strong.";
}
?>
</body>
</html>
The most helpful PHP solutions
detect browser phpPHP Click to see more ... 4.6K 408