多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## ucfirst 将字符串的首字母转换为大写 将 str 的首字符(如果首字符是字母)转换为大写字母,并返回这个字符串。 ~~~ string ucfirst ( string $str ) ~~~ **eg** ~~~ <?php $foo = 'hello world!'; $foo = ucfirst($foo); // Hello world! $bar = 'HELLO WORLD!'; $bar = ucfirst($bar); // HELLO WORLD! $bar = ucfirst(strtolower($bar)); // Hello world! ?> ~~~ ## lcfirst使一个字符串的第一个字符小写 **eg** ~~~ <?php $foo = 'HelloWorld'; $foo = lcfirst($foo); // helloWorld $bar = 'HELLO WORLD!'; $bar = lcfirst($bar); // hELLO WORLD! $bar = lcfirst(strtoupper($bar)); // hELLO WORLD! ?> ~~~