![]() |
VOOZH | about |
The strlen() is a built-in function in PHP which returns the length of a given string.
It calculates the length of the string including all the whitespaces and special characters.
strlen($string);This parameter represents the string whose length is needed to be returned.
The function returns the length of the $string including all the whitespaces and special characters.
Example 1: The below example demonstrates the use of the strlen() function in PHP.
Output:
13Example 2: This example demonstrates the use of the strlen() function where the string has special characters and escape sequences.
Output:
25PHP is a server-side scripting language designed specifically for web development. You can learn PHP from the ground up by following this PHP Tutorial and PHP Examples.