Function name: mb_get_info()
Function: Get relevant information about the multibyte string function of the current system
Applicable version: PHP 4 >= 4.0.6, PHP 5, PHP 7
Usage: mb_get_info(void): array
Description: The mb_get_info() function returns an associative array containing the relevant information of the multibyte string function. This information includes supported character encoding, function version number, internal encoding, etc.
Return value: An associative array containing the relevant information of a multibyte string function. The key of the array is the name of the information and the value is the corresponding value.
Example:
$info = mb_get_info(); echo "MBstring 扩展版本号:" . $info['version'] . "<br>"; echo "支持的字符编码:"; print_r($info['internal_encoding']);
Output:
MBstring 扩展版本号:1.3.11支持的字符编码:Array ( [0] => ASCII [1] => UTF-8 [2] => UTF-16 [3] => UTF-32 )
In the above example, first call the mb_get_info() function to obtain relevant information of the multi-byte string function, and assign the returned associative array to the variable $info. Then get the version number of the MBstring extension through $info['version'] and get the supported character encoding through $info['internal_encoding']. Finally, output this information to the page.
Please note that the outputs in the examples are for reference only and the actual output may vary depending on the system environment and version.