Mb_internal_encoding
- (PHP 4 >= 4.0.6, PHP 5, PHP 7)
- Mb_internal_encoding-set/get Internal character encoding
- Set or get the internal character set
Description
mb_internal_encoding([$encodingmb_internal_encoding()])//Set/Get the internal character encoding
Parametersencoding
Encoding is the character encoding name used for the HTTP input character encoding conversion, HTTP output character encod ing conversion, and the default character encoding for string functions defined by the Mbstring module. You should notice the internal encoding are totally different from the one for multibyte regex.
Character encoding is used for HTTP input, output character encoding conversion, and the default character encoding is defined by the Mbstring module string function. You should notice that the internal code is completely different from the multi-byte regular expression.
Return Values
IF encoding is set and then Returns TRUE on success or FALSE on failure. The character encoding for multibyte regex are not changed. IF encoding is omitted and then the current character encoding name is returned.
If the encoding is set, the success returns TRUE or False when it fails. In this case, the multi-byte character encoding does not change the regular expression. If the encoding is omitted, the current character encoding name is returned.
Examples
<?php/*** Created by Phpstorm.* User:zhangrongxiang* DATE:2018/1/26* Time: PM 10:18 *// * Set internal character encoding to UTF-8 * /mb_internal_encoding("UTF-8");/ * Display Current internal character encoding * /Echo mb_internal_encoding().Php_eol; //UTF-8mb_internal_encoding("GBK");Echo mb_internal_encoding().Php_eol; //cp936mb_internal_encoding("CP936");Echo mb_internal_encoding().Php_eol; //cp936mb_internal_encoding("Iso-8859-1");Echo mb_internal_encoding().Php_eol; //iso-8859-1
Article reference
- http://php.net/manual/en/function.mb-internal-encoding.php
Reprint Annotated Source
PHP mb_internal_encoding Use