當前位置: 首頁> 函數類別大全> str_repeat

str_repeat

重複一個字符串
名稱:str_repeat
分類:字符串
所屬語言:php
一句話介紹:把字符串重複指定的次數。

實例

把字符串"Shanghai " 重複5 次:

 <span class="token php language-php"><span class="token delimiter important"><?php</span>
<span class="token keyword">echo</span> <span class="token function">str_repeat</span> <span class="token punctuation">(</span> <span class="token string double-quoted-string">"Shanghai"</span> <span class="token punctuation">,</span> <span class="token number">5</span> <span class="token punctuation">)</span> <span class="token punctuation">;</span>
<span class="token delimiter important">?></span></span>

親自試一試

同類函數
  • 將字符串中每個單詞的首字母轉換為大寫 ucwords

    ucwords

    將字符串中每個單詞的首字母轉換為大寫
  • 二進制安全比較字符串開頭的若干個字符(不區分大小寫) strncasecmp

    strncasecmp

    二進制安全比較字符串開頭的若干個字符(不
  • 檢查字符串是否以給定的子字符串開頭 str_starts_with

    str_starts_with

    檢查字符串是否以給定的子字符串開頭
  • 二進制安全比較字符串開頭的若干個字符 strncmp

    strncmp

    二進制安全比較字符串開頭的若干個字符
  • 計算指定字符串在目標字符串中最後一次出現的位置(不區分大小寫) strripos

    strripos

    計算指定字符串在目標字符串中最後一次出現
  • 二進制安全字符串比較 strcmp

    strcmp

    二進制安全字符串比較
  • 查詢語言和區域設置信息 nl_langinfo

    nl_langinfo

    查詢語言和區域設置信息
  • 將一個一維數組的值轉化為字符串 implode

    implode

    將一個一維數組的值轉化為字符串
熱門文章