← 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), defaultnull, optional
Returns: array|string|false
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported through a declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/string/mb_convert_encoding.rs).
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.