The mb_get_info() function in PHP is used to get the internal settings of mbstring. This function is supported in PHP 5.4 or higher version.
array|string|int mb_get_info(str $type = "all")
It accepts only a single parameter to get the multibyte information.
$type − If the type parameter is not specified or it is specified as "all", then it will return the following information −
"internal_encoding", "http_input", "http_output", "http_output_conv_mimetypes", "mail_charset", "mail_header_encoding", "mail_body_encoding", "illegal_chars", "encoding_translation", "language", "detect_order", "substitute_character", "strict_detection"
If the type parameter is specified as any of the following −
"internal_encoding", "http_input", "http_output", "http_output_conv_mimetypes", "mail_charset", "mail_header_encoding", "mail_body_encoding", "illegal_chars", "encoding_translation", "language", "detect_order", "substitute_character" or "strict_detection",
然后它将返回指定的设置参数。
mb_get_info()如果未指定type,则返回type信息的数组,否则返回特定的类型。失败时返回false。
注意 − 从PHP 8.0.0开始,不支持"func_overload"和"func_overload_list"类型。
<?php $string=mb_get_info(); print_r($string); ?>
Array ( [internal_encoding] => UTF-8 [http_output] => UTF-8 [http_output_conv_mimetypes] => ^(text/|application/xhtml+xml) [mail_charset] => UTF-8 [mail_header_encoding] => BASE64 [mail_body_encoding] => BASE64 [illegal_chars] => 0 [encoding_translation] => Off [language] => neutral [detect_order] => Array ( [0] => ASCII [1] => UTF-8 ) [substitute_character] => 63 [strict_detection] => Off )