← All docs

mb_convert_encoding()

Converts strings and recursive array keys and values between character encodings.

mb_convert_encoding()

function mb_convert_encoding(array|string $string, string $to_encoding, array|string|null $from_encoding = null): array|string|false

Converts strings and recursive array keys and values between character encodings.

Parameters:

  • $string (array|string)
  • $to_encoding (string)
  • $from_encoding (array|string|null), default null, optional

Returns: array|string|false

Availability

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

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