PHP strlen() Function
PHP strlen() Function
The strlen() function in PHP is used to return the length of the specified string.
Syntax
strlen ( string $string )
Parameter
string(required)- This parameter represents the string which is measured for length.
Return
This function returns the length of the string on success or returns 0 if the specified string is empty.
Example 1
Output
Original string: Hello Tutorial And Example The length of string: 26
Example 2
Output
Original string: T A E The length of string: 8
Example 3
Output
Original string: The length of string: 0
Example 4
Output
The string is empty. Please insert some value!
