函数名称:strtoupper()
函数功能:将字符串中的所有小写字母转换为大写字母
适用版本:所有版本的 PHP
语法:strtoupper(string $string): string
参数:
- $string:要转换的字符串
返回值:返回转换后的字符串
示例:
$string = "hello world";
$uppercaseString = strtoupper($string);
echo $uppercaseString;
输出结果:
HELLO WORLD
说明:
strtoupper() 函数将字符串中的所有小写字母转换为大写字母,并返回转换后的字符串。在示例中,我们定义了一个字符串变量 $string,其值为 "hello world"。然后,我们调用 strtoupper() 函数,将 $string 中的所有小写字母转换为大写字母,并将转换后的结果赋值给变量 $uppercaseString。最后,我们使用 echo 输出 $uppercaseString,结果为 "HELLO WORLD"。
热门工具排行榜