当前位置: 首页> 函数类别大全> 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>

亲自试一试

同类函数
  • 将字符串拆分为较小的块 chunk_split

    chunk_split

    将字符串拆分为较小的块
  • 重复一个字符串 str_repeat

    str_repeat

    重复一个字符串
  • 返回格式化的字符串 sprintf

    sprintf

    返回格式化的字符串
  • 输出格式化的字符串 printf

    printf

    输出格式化的字符串
  • 二进制安全字符串比较 strcmp

    strcmp

    二进制安全字符串比较
  • 将所有适用的字符转换为HTML实体-将字符转换为 HTML 转义字符 htmlentities

    htmlentities

    将所有适用的字符转换为HTML实体-将字
  • 获取不匹配遮罩的起始子字符串的长度 strcspn

    strcspn

    获取不匹配遮罩的起始子字符串的长度
  • 翻译字符或替换子字符串-转换指定字符 strtr

    strtr

    翻译字符或替换子字符串-转换指定字符
热门文章