strlen()

Returns the length (number of bytes) of a string.

Syntax

php
strlen(string $str): int

Example

php
echo strlen("Hello");      // 5
echo strlen("");           // 0
echo strlen("Hello\n");   // 6