149-PHP大小写转换函数
作者:互联网
<?php $str='PHP is a very good programming language.'; //定义一个字符串 echo "未经处理的字符串:<br />{$str}"; //分别使用各个函数处理字符串并输出处理后的结果 $str=strtolower($str); echo "<br />使用strtolower函数将字符串转换为小写:<br />{$str}"; $str=ucfirst($str); echo "<br />使用ucfirst函数将字符串首字母转换为大写:<br />{$str}"; $str=ucwords($str); echo "<br />使用ucwords函数将字符串每个单词的首字母转换为大写:<br />{$str}"; $str=strtoupper($str); echo "<br />使用strtoupper函数将字符串转换为大写:<br />{$str}"; ?>
标签:149,转换,函数,大写,echo,大小写,str,字符串,PHP 来源: https://www.cnblogs.com/tianpan2019/p/11022733.html