PHP str_repeat()関数
例
文字列「Wow」を13回繰り返します。
<?php
echo str_repeat("Wow",13);
?>
定義と使用法
str_repeat()関数は、指定された回数だけ文字列を繰り返します。
構文
str_repeat(string,repeat)
パラメータ値
Parameter | Description |
---|---|
string | Required. Specifies the string to repeat |
repeat | Required. Specifies the number of times the string will be repeated. Must be greater or equal to 0 |
技術的な詳細
戻り値: | 繰り返される文字列を返します |
---|---|
PHPバージョン: | 4歳以上 |
❮PHP文字列リファレンス