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