← 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) | Magician (eval) |
|---|---|
| Available | Available |
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.