GitHubContribute in GitHub: Edit online

strlen()

Returns the length, in characters, of the input string.

Syntax

strlen(source)

Arguments

  • source: The source string that will be measured for string length.

Returns

Returns the length, in characters, of the input string.

Notes

This function counts Unicode code points.

Examples

print length = strlen("hello")

length
5
print length = strlen("⒦⒰⒮⒯⒪")

length
5
print strlen('Çedilla') // the first character is a grapheme cluster
                        // that requires 2 code points to represent

length
8