PHP共有8个字符串大小写转换的函数: strtoupper()、strtolower()、ucfirst()、ucfirst()、ucwords()、mb_strtoupper()、mb_strtolower()和mb_convert_case() 这八个函数的区别和联系: 函数名称-------使用范围-------功能 strtoupper-------PHP4、PHP5-------将字符串转化为大写 strtolower-------PHP4、PHP5-------将字符串转化为小写 ucfirst-------PHP4、PHP5-------将字符串的首字母转化为大写 lcfirst-------PHP5>= 5.3.0-------将字符串的首字母转化为小写 ucwords-------PHP4、PHP5-------将字符串中每个单词的首字符转化为大写 mb_strtoupper-------PHP4>=4.3.0,PHP 5-------将字符串转化为大写(与strtoupper函数有区别) mb_strtolower-------PHP4>=4.3.0,PHP 5-------将字符串转化为小写(与strtolower函数有区别) mb_convert_case-------PHP4>=4.3.0,PHP 5-------按照不同的模式对字符串进行转换 Loading... PHP共有8个字符串大小写转换的函数: strtoupper()、strtolower()、ucfirst()、ucfirst()、ucwords()、mb_strtoupper()、mb_strtolower()和mb_convert_case() 这八个函数的区别和联系: 函数名称-------使用范围-------功能 strtoupper-------PHP4、PHP5-------将字符串转化为大写 strtolower-------PHP4、PHP5-------将字符串转化为小写 ucfirst-------PHP4、PHP5-------将字符串的首字母转化为大写 lcfirst-------PHP5>= 5.3.0-------将字符串的首字母转化为小写 ucwords-------PHP4、PHP5-------将字符串中每个单词的首字符转化为大写 mb_strtoupper-------PHP4>=4.3.0,PHP 5-------将字符串转化为大写(与strtoupper函数有区别) mb_strtolower-------PHP4>=4.3.0,PHP 5-------将字符串转化为小写(与strtolower函数有区别) mb_convert_case-------PHP4>=4.3.0,PHP 5-------按照不同的模式对字符串进行转换 最后修改:2020 年 01 月 04 日 © 允许规范转载 打赏 赞赏作者 支付宝微信 赞 支持就是力量