导航首页 » 技术教程 » PHP:mb_internal_encoding()的用法_mbstring函数
PHP:mb_internal_encoding()的用法_mbstring函数 157 2023-12-11   

mb_internal_encoding

(PHP 4 >= 4.0.6, PHP 5)

mb_internal_encoding — 设置/获取内部字符编码

说明

mixed mb_internal_encoding ([ string $encoding = mb_internal_encoding() ] )

设置/获取内部字符编码

参数

encoding

encoding 字符编码名称使用于 HTTP 输入字符编码转换、HTTP 输出字符编码转换、mbstring 模块系列函数字符编码转换的默认编码。 You should notice that the internal encoding is totally different from the one for multibyte regex.

返回值

如果设置了 encoding,则成功时返回 TRUE, 或者在失败时返回 FALSE。 In this case, the character encoding for multibyte regex is NOT changed. 如果省略了 encoding,则返回当前的字符编码名称。

范例

Example #1 mb_internal_encoding() 例子

<?php
/* 设置内部字符编码为 UTF-8 */
mb_internal_encoding("UTF-8");

/* 显示当前的内部字符编码*/
echo mb_internal_encoding();
?>

参见

mb_http_input() - 检测 HTTP 输入字符编码 mb_http_output() - 设置/获取 HTTP 输出字符编码 mb_detect_order() - 设置/获取 字符编码的检测顺序 mb_regex_encoding() - Set/Get character encoding for multibyte regex


!!!站长长期在线接!!!

网站、小程序:定制开发/二次开发/仿制开发等

各种疑难杂症解决/定制接口/定制采集等

站长微信:lxwl520520

站长QQ:1737366103