.
Divya
The strlen() function is used to returns the length of a string in PHP.
strlen(string)
<!DOCTYPE html>
<html>
<body>
<?php
echo strlen("Students Tutorial");
?>
</body>
</html>
For know the length of a user password at the time of form input.
<!DOCTYPE html>
<html>
<body>
<?php
if(isset($_POST['save']))
{
$name = $_POST['name'];
$email = $_POST['email'];
$password = $_POST['password'];
$count=strlen($password);
if ($count>=6){
echo "";
}
else {
echo "Password length at least 6";
}
}
?>
<form method="post" action="">
Name:<br>
<input type="text" name="name">
<br>
Email Id:<br>
<input type="email" name="email">
<br>Password:<br>
<input type="password" name="password">
<br><br>
<input type="submit" name="save" value="submit">
</form>
</body>
</html>
.