mb_language()
mb_language() — Set/Get current language.
Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.0.6, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
Signature
mb_language(?string $language = null): string|bool
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $language | ?string | Used for encoding e-mail messages. The valid languages are listed in the following table. mb_send_mail() uses this setting to encode e-mail. |
Return value
If language is set and language is valid, it returns true. Otherwise, it returns false. When language is omitted or null, it returns the language name as a string.
Example
The PHP manual ships no example for mb_language(); the signature and the parameter table above are the contract.
Changelog
| Version | Change |
|---|---|
| 8.0.0 | language is nullable now. |
See also
All PHP 8.5 built-in functions
Reference card built from the PHP manual page mb_language() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.