php怎么将字符串转为小写

php可以将字符串转为小写

方法1:使用strtolower() 函数

strtolower() 函数把字符串转换为小写。

语法:

strtolower(string)

示例:

<?php
echo strtolower("Hello WORLD!");
?>

输出:

hello world!

方法2:使用lcfirst()函数

lcfirst() 函数把字符串中的首字符转换为小写。

语法:

lcfirst(string)

示例:

<?php
echo lcfirst("HELLO WORLD!");
?>

输出:

hELLO WORLD!
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容