php:codesnip:regex-cek-string-password
This is an old revision of the document!
Error loading plugin box
ParseError: syntax error, unexpected token "{"
More info is available in the error log.
ParseError: syntax error, unexpected token "{"
More info is available in the error log.
Error loading plugin changes
ParseError: syntax error, unexpected token "{"
More info is available in the error log.
ParseError: syntax error, unexpected token "{"
More info is available in the error log.
PHP Cek String Password Mengandung Huruf Besar, Kecil Angka
Berikut ini adalah contoh kode snip php yang berfungsi untuk mengecek panjang password, apakah mengandung huruf besar, huruf kecil dan angka.
Contoh 1
$pass="paswdT6Sa";
$uppercase = preg_match('@[A-Z]@', $pass);
$lowercase = preg_match('@[a-z]@', $pass);
$number = preg_match('@[0-9]@', $pass);
if(!$uppercase || !$lowercase || !$number || strlen($pass)<=6){
echo "password harus minimal 6 karakter, mengandung huruf besar, huruf kecil dan angka";
}else{
echo "password memenuhi kriteria";
}
Layanan
Harga Domain .COM | Harga Domain .ID | Shared Hosting | Email Hosting | MySQL Hosting |php/codesnip/regex-cek-string-password.1463197267.txt.gz · Last modified: by kbadmin
