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

str_repeat

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

定義和用法

str_repeat()函數把字符串重複指定的次數。

實例

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

 <?php
echo str_repeat ( "Shanghai" , 5 ) ;
?>

親自試一試

文法

str_repeat ( string , repeat )
參數 描述
string 必需。規定要重複的字符串。
repeat 必需。規定字符串將被重複的次數。必須大於等於0。
同類函數
  • 設置區域設置信息 setlocale

    setlocale

    設置區域設置信息
  • 輸出格式化的字符串 printf

    printf

    輸出格式化的字符串
  • 解碼一個uuencode 編碼的字符串 convert_uudecode

    convert_uudecode

    解碼一個uuencode編碼的字符串
  • 將數字格式化成貨幣字符串 money_format

    money_format

    將數字格式化成貨幣字符串
  • 不區分大小寫的strstr stristr

    stristr

    不區分大小寫的strstr
  • 刪除字符串末端的空白字符(或者其他字符) rtrim

    rtrim

    刪除字符串末端的空白字符(或者其他字符)
  • 使用反斜線轉義字符串 addslashes

    addslashes

    使用反斜線轉義字符串
  • 將二進制數據轉換為十六進製表示 bin2hex

    bin2hex

    將二進制數據轉換為十六進製表示
熱門文章