Calculating the length of a string : strlen « String « PHP






Calculating the length of a string

 
<?php
$password="password";

if (strlen($password) <= 5){

    echo("Passwords must be at least 5 characters long.");
}
else {
    echo ("Password accepted.");
}
?>
  
  








Related examples in the same category

1.Checking String Length
2.Checking String Length: int strlen ( string string )
3.Concisely checking the length of a trimmed string
4.strlen.php
5.int strlen ( string str ) returns the number of characters in it: