← All docs

iconv_substr()

Extracts a character-indexed slice of a string.

iconv_substr()

function iconv_substr(string $string, int $offset, ?int $length = null, ?string $encoding = null): mixed

Extracts a character-indexed slice of a string.

Parameters:

  • $string (string)
  • $offset (int)
  • $length (?int), default null, optional
  • $encoding (?string), default null, optional

Returns: mixed

Availability

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

Internals

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