PHP strlen() Function

4 Sept 2024 | 1 min read

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:

ParameterDescriptionRequired/Optional
StringSpecify the string to check.Required.

Example 1

Output:

Your String is:Javatpoint 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:


Next TopicPHP String