← All docs

mb_strlen()

Returns the character count of a string in the requested encoding.

mb_strlen()

function mb_strlen(string $string, string $encoding = null): int

Returns the character count of a string in the requested encoding.

Parameters:

  • $string (string)
  • $encoding (string), default null, optional

Returns: int

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how mb_strlen is implemented in the compiler, see the internals page.