首页 > Web开发 > 详细

【函数分享】每日PHP函数分享(2021-1-28)

时间:2021-01-28 18:22:05      阅读:16      评论:0      收藏:0      [点我收藏+]

lcfirst() 使一个字符串的第一个字符小写。 

string lcfirst ( string $str )

  


说明:返回str的第一个字符小写了的字符串。如果str的第一个字符是字母,则将其转换为小写。 

 

需要注意的是"字母"是由当前语言区域决定的。比如,在默认的"C"区域像日耳曼语系中的元音变音a (?) 将不会被转换。

 

参数描述

 

str

输入的字符串。

 

返回值:返回转换后的字符串。  


实例:

<?php
$foo = ‘HelloWorld‘;
$foo = lcfirst($foo);
echo $foo;
// helloWorld
$bar = ‘HELLO WORLD!‘; $bar = lcfirst($bar); echo $bar; // hELLO WORLD!
$bar = lcfirst(strtoupper($bar)); echo $bar; // hELLO WORLD! ?>

  


输出:

// helloWorld
// hELLO WORLD!
// hELLO WORLD!

  

【函数分享】每日PHP函数分享(2021-1-28)

原文:https://www.cnblogs.com/leruge/p/14337921.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!