PHP 5.6.38 Released

mb_language

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

mb_language设置/获取当前的语言

说明

mixed mb_language ([ string $language = mb_language() ] )

设置/获取当前的语言。

参数

language

用于编码邮件信息。有效的语言有:"Japanese","ja","English","en" 和 "uni"(UTF-8)。 mb_send_mail() 使用了该设置来对邮件进行编码。

语言和它的设置,日文是 ISO-2022-JP/Base64,uni 是 UTF-8/Base64,英文是 ISO-8859-1/quoted。

返回值

如果设置了 language,并且 language 是有效的,它将返回 TRUE。否则将返回 FALSE。 当省略了 language 参数,它将返回语言名称的 string。如果之前没有设置过语言,则将返回 FALSE

参见

add a note add a note

User Contributed Notes 3 notes

up
1
Anonymous
1 month ago
In addition, the undocumented "neutral" is also accepted as a valid language setting. That is also the default value if the INI setting is not set:
<?php
var_dump
( mb_language( 'neutral' ) );     // TRUE; accepted as language string
var_dump( mb_language() );                    // 'neutral'
?>

The documentation of this particular INI setting and function is ambiguous.
up
-1
pablorodriguez85 at gmail dot com
3 years ago
In PHP 5.5.9-1ubuntu4.11 (cli) it returns "neutral"
up
-2
Anonymous
4 years ago
In PHP 5.3, mb_language() returns "neutral" by default for me.
To Top