ucfirst()

上一节: Func_string_trim 下一节: Func_string_ucwords

PHP ucfirst() 函数

分类:PHP字符串函数参考手册

把 "hello" 的首字符转换为大写:


示例

<?php
echo ucfirst("hello world!");
?>

定义和用法

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

相关函数:

语法


ucfirst(string)

参数 描述
string 必需。规定要转换的字符串。

技术细节

返回值: 返回已转换的字符串。
PHP 版本: 4+

分类:PHP字符串函数参考手册

上一节: Func_string_trim 下一节: Func_string_ucwords
此页面最后编辑于2022年8月17日 (星期三) 22:30。