马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
x
做程序开发处理字符串是再正常不过的事了,字母大小写转换主要涉及以下五个函数: lcfirst() 函数把字符串中的首字符转换为小写。 ucfirst() 把字符串中的首字符转换为大写。 ucwords() 把字符串中每个单词的首字符转换为大写。 strtoupper() 把字符串转换为大写。 strtolower() 把字符串转换为小写。
示例: $str1='Hello word'; $str2='hello word'; echo lcfirst($str1); 输出:hello word echo ucfirst($str2); 输出:Hello word echo ucwords($str2); 输出:Hello Word echo strtoupper($str1); 输出:HELLO WORD echo strtolower($str1); 输出:hello word
|