121
PHP strlen() Function
The strlen() function is predefined function of PHP. It is used to find the length of string or returns the length of a string including all the whitespaces and special character.
Syntax:
Parameter | Description | Required/Optional |
---|---|---|
String | Specify the string to check. | Required. |
Example 1
Output:
Your String is:Tutoraspire By using 'strlen()' function:10
Example 2
Output:
Your String is:Java T point By using 'strlen()' function:12
Example 3
Output:
Your String is:P H P By using 'strlen()' function:11
Reference:
http://php.net/manual/en/function.strlen.php
See Also:
- str_split() : It is used to split a string into an array.
- str_word_count() : It is used to count the number of words in a string.
- strcasecmp() : It is used to compare two strings.
Next TopicPHP String