【小结】
-
lcfirst —使一个字符串的第一个字符小写。
-
ucfirst — 将字符串的首字母转换为大写。
-
strtolower — 将字符串转化为小写。
-
strtoupper — 将字符串转化为大写。
-
ucwords — 将字符串中每个单词的首字母转换为大写。
//大小写转化
//lcfirst 返回第一个字母小写的 str ,如果是字母的话。
echo lcfirst('Hello Tacks!'),'<br/>';//hello Tacks!
echo lcfirst('9Hello Tacks!'),'<br/>';//9Hello Tacks!
//ucfirst 将 str 的首字符(如果首字符是字母)转换为大写字母,并返回这个字符串。
echo ucfirst('hello tacks!'),'<br/>';//Hello tacks!
echo ucfirst('9hello tacks!'),'<br/>';//9hello tacks!
//strtolower 将 string 中所有的字母字符转换为小写并返回。
echo strtolower('HELLO TACKS!'),'<br/>';//hello tacks!
//strtoupper 将 string 中所有的字母字符转换为大写并返回。
echo strtoupper('hello tacks!'),'<br/>';//HELLO TACKS!
//ucwords 将 str 中每个单词的首字符(如果首字符是字母)转换为大写字母,并返回这个字符串。
echo ucwords('hello,this is my dog!'),'<br/>';//Hello,this Is My Dog!