我想知道如何在PHP中利用

有帮助吗?

解决方案

echo strtoupper('hello');

strtoupper 将利用整个字符串。

如果你只在大写首字母兴趣,你可以使用 ucfirst

echo ucfirst('hello!'); //Hello!

如果您想为每个字的第一个字母串,使用 ucwords

echo ucwords('hello world!'); //Hello World!

其他提示

strtoupper() 功能是你在找什么。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top