当前位置: 首页> 函数类别大全> ucfirst

ucfirst

将字符串的第一个字符设为大写
名称:ucfirst
分类:字符串
所属语言:php
一句话介绍:把字符串中的首字符转换为大写。

实例

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

<span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">ucfirst</span><span class="token punctuation">(</span><span class="token string double-quoted-string">"hello world!"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

亲自试一试

同类函数
  • 重复一个字符串 str_repeat

    str_repeat

    重复一个字符串
  • 转换十六进制字符串为二进制字符串 hex2bin

    hex2bin

    转换十六进制字符串为二进制字符串
  • 以 C 语言风格使用反斜线转义字符串中的字符 addcslashes

    addcslashes

    以C语言风格使用反斜线转义字符串中的字符
  • 检查字符串是否以给定的子字符串开头 str_starts_with

    str_starts_with

    检查字符串是否以给定的子字符串开头
  • implode的别名 join

    join

    implode的别名
  • 从字符串中删除 HTML和PHP标记 strip_tags

    strip_tags

    从字符串中删除HTML和PHP标记
  • 以千位分隔符方式格式化一个数字 number_format

    number_format

    以千位分隔符方式格式化一个数字
  • 设置区域设置信息 setlocale

    setlocale

    设置区域设置信息
热门文章