Current Location: Home> Function Categories> strlen

strlen

Get the string length
Name:strlen
Category:String
Programming Language:php
One-line Description:Returns the length of the string.

Definition and usage

strlen() function returns the length of the string.

Example

Example 1

The function returns the length of the string "Shanghai":

 <?php
echo strlen ( "Shanghai" ) ;
?>

Try it yourself

Example 2

Returns the length of the string "I love Shanghai!":

 <?php
echo strlen ( "I love Shanghai!" ) ;
?>

Try it yourself

grammar

 strlen ( string )
parameter describe
string Required. Specifies the string to be checked.
Similar Functions
  • Escape strings using backslash addslashes

    addslashes

    Escapestringsusingba
  • Tag split string strtok

    strtok

    Tagsplitstring
  • Output formatted string printf

    printf

    Outputformattedstrin
  • Case-insensitive strstr stristr

    stristr

    Case-insensitivestrs
  • Find the first occurrence of a string strstr

    strstr

    Findthefirstoccurren
  • Binary safe comparison of several characters at the beginning of a string strncmp

    strncmp

    Binarysafecomparison
  • Output formatted string vprintf

    vprintf

    Outputformattedstrin
  • Write the formatted string to the stream fprintf

    fprintf

    Writetheformattedstr
Popular Articles