资讯专栏INFORMATION COLUMN

PHP之mb_internal_encoding使用

charles_paul / 3027人阅读

摘要:设置或获取内部字符集字符编码用于输入,输出字符编码转换,默认的字符编码由模块字符串函数定义的。如果设置了编码,则成功返回或失败时返回。在这种情况下,对多字节字符编码不改变正则表达式。

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

文章参考

http://php.net/manual/en/func...

转载注明出处

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/28183.html

相关文章

  • PHPmb_strripos使用

    摘要:大小写不敏感地在字符串中查找一个字符串最后出现的位置基于字符数执行一个多字节安全的操作。的位置是从的开始进行统计的。使用的字符编码名称。如果省略了,则将使用内部编码。如果没有找到,它将返回。 mb_strripos (PHP 4 >= 4.0.6, PHP 5, PHP 7) mb_strrpos — Find position of last occurrence of a str...

    longshengwang 评论0 收藏0
  • PHPmb_strpos使用

    摘要:第一个字符的位置是,第二个字符的位置是,以此类推。和不同的是,数字的值不会被当做字符的顺序值。搜索位置的偏移。如果没有提供该参数,将会使用。负数的会从字符串尾部开始统计。如果省略,则使用内部字符编码。返回的中首次出现位置的数值。 mb_strpos (PHP 4 >= 4.0.6, PHP 5, PHP 7) mb_strpos — Find position of first oc...

    B0B0 评论0 收藏0
  • PHPmb_strrpos使用

    摘要:查找字符串在一个字符串中最后出现的位置基于字符数执行一个多字节安全的操作。的位置是从的开始进行统计的。可以用于指定里从任意字符数开始进行搜索。负数的值将导致搜索会终止于指向末尾的任意点。如果省略,则使用内部字符编码。如果没有找到,它将返回。 mb_strrpos (PHP 4 >= 4.0.6, PHP 5, PHP 7) mb_strrpos — Find position of ...

    MingjunYang 评论0 收藏0
  • PHPmb_convert_case使用

    摘要:对字符串进行大小写转换对一个进行大小写转换,转换模式由指定。如果省略,则使用内部字符编码。剩下的没有提及的二进制位,全部为这个符号的码。 mb_convert_case (PHP 4 >= 4.3.0, PHP 5, PHP 7) mb_convert_case — Perform case folding on a string mb_convert_case — 对字符串进行大小...

    lixiang 评论0 收藏0
  • PHPmb_check_encoding使用

    摘要:检查字符串在指定的编码里是否有效检查指定的字节流在指定的编码里是否有效。它能有效避免所谓的无效编码攻击。要检查的字节流。成功时返回,或者在失败时返回。输出空输出编码的字符串设置文件编码为博客园和。 mb_check_encoding (PHP 4 >= 4.4.3, PHP 5 >= 5.1.3, PHP 7) mb_check_encoding — Check if the str...

    tracymac7 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<