The function returns the length of the string "Hello":
<?phpecho strlen("Hello");?>The strlen() function returns the length of the string.
strlen( string )
parameter | describe |
---|---|
string | Required. Specifies the string to check. |
Return value: | Returns the length of the string if successful, or 0 if the string is empty. |
---|---|
PHP version: | 4+ |
Update log: | Prior to PHP 5.3.0, this function treated the array as an Array of strings, thus returning a string of length 5 and generating an E_NOTICE level error. |
Return the length of the string "Hello World":
<?phpecho strlen("Hello world!");?>