![php英文字母大小写转换功能汇总 php英文字母大小写转换功能汇总](/rjstyle/noimg/20.webp)
复制代码代码如下:< PHP
变量$foo = 'Hello World!
为foo = ucwords($ Foo); / /你好世界!
$吧= 'Hello World!
$吧= ucwords($条); / /你好世界!
酒吧= ucwords(strtolower美元(美元吧)); / /你好世界!
>
第一个词的首字母大写,ucfirst成为()
复制代码代码如下:< PHP
变量$foo = 'Hello World!
为foo = ucfirst($ Foo); / /你好世界!
$吧= 'Hello World!
$吧= ucfirst($条); / /你好世界!
酒吧= ucfirst(strtolower美元(美元吧)); / /你好世界!
>
一个单词的首字母变成了:lcfirst()
复制代码代码如下:< PHP
美元'helloworld foo =;
为foo = lcfirst($ Foo); / / HelloWorld
$吧= 'Hello World!
$吧= lcfirst($条); / /你好世界!
酒吧= lcfirst(strtoupper美元(美元吧)); / /你好世界!
>
所有的字母出现:strtoupper()
所有的信件拒绝:strtolower()