PHP length of string

Getting the length of a string is done easily in PHP by using the strlen($string_variable) function.

<title> Length of string</title>
<form action="stringlen.php" method="get">
<label for="pwd">Password:</label>
<input type="password" name="pwd">
<input type="submit" name="sm" value="Submit">
if(strlen($p)<8) echo "<p style='color: #ff0000'> Too short!</p>";
else echo "<p style='color: #0000ff'> Good!</p>";


Posted by: Lavy | post date: 02-04-2013 | Subject: PHP

This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.