PHP check password strength php - Net-Raft.com

Welcome aboard! We are happy you are here and wish you good net-raft!




Just a Web Code Solution
join us

check password strength php


 539

Show ResultPHP


3

<!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>


By        
The power of the user (%)
15%



The most helpful PHP solutions

detect browser phpdetect browser phpPHP

Click to see more ...

  4.6K     408

create QR code phpcreate QR code phpPHP

Click to see more ...

  3K     289

create relative date phpcreate relative date phpPHP

Click to see more ...

  2.2K     264

drag and drop upload file using phpdrag and drop upload file using phpPHP

Click to see more ...

  2.7K     253

delete array item phpdelete array item phpPHP

Click to see more ...

  2.4K     245

detect ie phpdetect ie phpPHP

Click to see more ...

  1.6K     213

detect speed internet phpdetect speed internet phpPHP

Click to see more ...

  1.6K     198

get current url phpget current url phpPHP

Click to see more ...

  1.7K     197

get meta tag phpget meta tag phpPHP

Click to see more ...

  1.4K     193

Get real client country using php ?Get real client country using php ?PHP

Click to see more ...

  1.4K     181

Welcome aboard!
We are happy you are here and
wish you good net-raft!