string_strlen() Function

  • PHP strlen() function returns the length of string. It tells us how many characters are their in string.
  • The given example shows the use of PHP strlen() function:
<!DOCTYPE html>

<html>

<body>

<?php

echo strlen("www.eitworld.com");

echo "<br>";

echo strlen("Popular Tutorial");

echo "<br>";

echo strlen("PHP Tutorial");

?>

</body>

</html>

Output

string
    In the above example:
  • First string www.eitworld.com contains 16 characters that's why its length is 16.
  • Second string Popular Tutorial contains 16 characters that's why its length is 16.
  • Third string PHP Tutorial contains 12 characters that's why its length is 12.