mb_detect_encoding
PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8
mb_detect_encoding - Detect character encoding
Example #1 Effect of <span class='function-parameter'>strict</span> parameter
Result: string(5) "UTF-8"
bool(false)
string(10) "ISO-8859-1"
string(10) "ISO-8859-1"
Example #2 Effect of order when multiple encodings match
Result: string(5) "UTF-8"
string(10) "ISO-8859-1"
string(10) "ISO-8859-5"
Example #3 mb_detect_encoding example
Example #4 of mb_detect_encoding