php怎么将字符串转为小写
时间:2021-06-01 来源:互联网
今天PHP爱好者给大家带来php将字符串转为小写的方法:1、strtolower()函数,可以将字符串中的字母全部转换为小写,语法“strtolower(字符串)”;2、lcfirst()函数,可以将字符串中的首字符转换为小写,语法“lcfirst(字符串)”。
本教程操作环境:windows7系统、PHP7.1版,DELL G3电脑
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!
以上就是php怎么将字符串转为小写的详细内容,更多请关注php爱好者其它相关文章!
相关阅读更多 +
-
抹茶交易所 2025-05-10
-
GQ币总量多少?GQ币发行量介绍 2025-05-10
-
klarna是什么 2025-05-10
-
GQ是什么币种?GQ币怎么样? 2025-05-10
-
比特币减半时间2024 2025-05-10
-
HMSTR币怎么买?HMSTR币买卖交易操作教程 2025-05-10
最近更新