← All built-ins / strlen()

strlen()

strlen(mixed $v): int

Parameters

NameTypeDescription
$vstring|arraythe string (bytes) or array (elements) to measure

Return value

Number of bytes in the string, or number of elements in the array.

Example

echo strlen("HolyPHP"), "
";
echo strlen(""), "
";
7
0

See also

count()substr()str_pad()