php internal,PHP之mb_internal_encoding使用

mb_internal_encoding

(PHP 4 >= 4.0.6, PHP 5, PHP 7)

mb_internal_encoding — Set/Get internal character encoding

设置或获取内部字符集

Description

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

//Set/Get the internal character encoding

Parameters

encoding

encoding is the character encoding name used for the HTTP input character encoding conversion, HTTP output character encoding conversion, and the default character encoding for string functions defined by the mbstring module. You should notice that the internal encoding is totally different from the one for multibyte regex.

字符编码用于HTTP输入,输出字符编码转换,默认的字符编码由mbstring模块字符串函数定义的。你应该注意到内部编码完全不同于多字节的正则表达式。

Return Values

If encoding is set, then Returns TRUE on success or FALSE on failure. In this case, the character encoding for multibyte regex is NOT changed. If encoding is omitted, then the current character encoding name is returned.

如果设置了编码,则成功返回TRUE或失败时返回FALSE。在这种情况下,对多字节字符编码不改变正则表达式。如果省略编码,则返回当前字符编码名称。

Examples

/**

* Created by PhpStorm.

* User: zhangrongxiang

* Date: 2018/1/26

* Time: 下午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-8

mb_internal_encoding("GBK");

echo mb_internal_encoding().PHP_EOL; //CP936

mb_internal_encoding("CP936");

echo mb_internal_encoding().PHP_EOL; //CP936

mb_internal_encoding("iso-8859-1");

echo mb_internal_encoding().PHP_EOL; //ISO-8859-1

文章参考

转载注明出处

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值