mb_strtoupper
Set the string to uppercase
Function name: mb_strtoupper()
Applicable version: PHP 4>=4.3.0, PHP 5, PHP 7
Usage: mb_strtoupper(string $str, string|null $encoding = null): string
The mb_strtoupper() function converts all characters in a string to uppercase letters and returns the converted string. This function is similar to the strtoupper() function, but also works for non-ASCII characters.
parameter:
Return value: Returns the string converted to capital letters.
Example:
$str = "hello world!"; $result = mb_strtoupper($str); echo $result; // 输出: HELLO WORLD! $str = "你好,世界!"; $result = mb_strtoupper($str, 'UTF-8'); echo $result; // 输出: 你好,世界!(因为大写字母只适用于ASCII字符)
Notes: