php The strlen method is used to return the length of a string. The syntax for using this function is "strlen(string)", where the parameter string specifies the string to be checked.
#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.
php What is the strlen method?
strlen() function returns the length of the string.
Syntax
strlen(string)
Note: Before PHP 5.3.0, this function treated the array as a string Array, thus returning a string of length 5 and generating an E_NOTICE level error. .
Parameter string required. Specifies the string to check.
Example
Return the length of the string "I love Shanghai!":
<?php echo strlen("I love Shanghai!"); ?>
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What is the php strlen method?. For more information, please follow other related articles on the PHP Chinese website!