每个单词的第一个字母
转换为大写:ucwords()
< 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()
PHP字符串首字母上面的例子将初始化所有萧边
分享你的内容。我希望能给你一个
参考,希望你能
支持它。