← All docs
mb_detect_encoding()
Guesses the most likely candidate encoding using the request's detection settings.
mb_detect_encoding()
function mb_detect_encoding(string $string, array|string|null $encodings = null, bool $strict = false): string|false
Guesses the most likely candidate encoding using the request’s detection settings.
Parameters:
$string(string)$encodings(array|string|null), defaultnull, optional$strict(bool), defaultfalse, optional
Returns: 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_detect_encoding.rs).
No examples yet. Check examples/ and showcases/ for usage patterns.
Internals
For how mb_detect_encoding is implemented in the compiler, see the internals page.