英[r??pi:t]? ?美[r??pit]??
vt.重複;複述,背誦
vi.重做;重複投票
#n.重複;(節(jié)目)重演;重複的事物
第三人稱單數(shù): repeats 複數(shù): repeats 現(xiàn)在分詞: repeating 過去式: repeated 過去分詞: repeated
php str_repeat()函數(shù) 語法
str_repeat()函數(shù)怎麼用?
php str_repeat()函數(shù)用來重複使用指定字串,語法是str_repeat(string,repeat),此函式會(huì)將字串重複指定的次數(shù)。
作用:重複使用指定字串
語法:str_repeat(string,repeat)
參數(shù):
參數(shù) | 描述 |
#string | 必須,要重複的字串 |
repeat | 必須,規(guī)定字串重複的次數(shù),必須大於等於0 |
說明:str_repeat()函數(shù)重複字串指定的次數(shù)
php str_repeat()函數(shù) 範(fàn)例
<?php $i = "hello world!"; $j = str_repeat($i,3);//設(shè)置字符串重復(fù)的次數(shù)為3 echo $j; ?>
運(yùn)行實(shí)例?
點(diǎn)擊"運(yùn)行實(shí)例"按鈕查看線上實(shí)例
輸出:
hello world!hello world!hello world!
<?php $i = "Learn PHP to come to php.cn<br>"; $j = str_repeat($i,3); print_r($j); ?>
#運(yùn)行實(shí)例?
#點(diǎn)擊"運(yùn)行實(shí)例" 按鈕查看線上實(shí)例
############# #輸出:######
Learn PHP to come to php.cn Learn PHP to come to php.cn Learn PHP to come to php.cn