PHP mb_internal_encoding Use

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.