Display the drop-down list

mb_detect_encoding()

« mb_decode_mimeheader | mb_encode_mimeheader »
<?php
$string 
mb_detect_encoding (
    
// string $str
    
?// [mixed $encoding_list = mb_detect_order()]
    
?  // [bool $strict = false]
);

// enter non UTF-8 characters in hex in $str
?>
Result
$string = 'UTF-8'
Examples
#1 mb_detect_encoding  ("éléphant")
#2 mb_detect_encoding  ("house")
#3 mb_detect_encoding  ("house",
 
"UTF-8, ASCII")
#4 mb_detect_encoding  ("house",
 [
=> "ASCII"=> "UTF-8"])