當前位置: 首頁> 函數類別大全> 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_replace

    str_replace

    子字符串替換
  • 返回格式化的字符串 sprintf

    sprintf

    返回格式化的字符串
  • 將二進制數據轉換為十六進製表示 bin2hex

    bin2hex

    將二進制數據轉換為十六進製表示
  • 將格式化的字符串寫入流 vfprintf

    vfprintf

    將格式化的字符串寫入流
  • 返回有關字符串中使用的字符的信息-統計string 中每個字節值(0..255)出現的次數 count_chars

    count_chars

    返回有關字符串中使用的字符的信息-統計s
  • 從字符串的開頭和結尾去除空格(或其他字符) trim

    trim

    從字符串的開頭和結尾去除空格(或其他字符
  • 查找字符串首次出現的位置(不區分大小寫) stripos

    stripos

    查找字符串首次出現的位置(不區分大小寫)
  • 返回使用htmlspecialchars() 和htmlentities() 後的轉換錶 get_html_translation_table

    get_html_translation_table

    返回使用htmlspecialchars
熱門文章