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

親自試一試

同類函數
  • 反轉一個字符串 strrev

    strrev

    反轉一個字符串
  • 將二進制數據轉換為十六進製表示 bin2hex

    bin2hex

    將二進制數據轉換為十六進製表示
  • 將一個一維數組的值轉化為字符串 implode

    implode

    將一個一維數組的值轉化為字符串
  • 將字符由一種Cyrillic 字符轉換成另一種 convert_cyr_string

    convert_cyr_string

    將字符由一種Cyrillic字符轉換成另
  • 輸出一個字符串 print

    print

    輸出一個字符串
  • 從字符串中刪除HTML和PHP標記 strip_tags

    strip_tags

    從字符串中刪除HTML和PHP標記
  • 將帶引號的可打印字符串轉換為8位字符串 quoted_printable_decode

    quoted_printable_decode

    將帶引號的可打印字符串轉換為8位字符串
  • strstr的別名 strchr

    strchr

    strstr的別名
熱門文章