Calculating the length of a string : strlen « String « PHP
- PHP
- String
- strlen
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