Example
Repeat the string "Wow" 13 times:
html
<?php
echo str_repeat("Wow",13);
?>
Definition and Usage
The str_repeat() function repeats a string a specified number of times.
Syntax
text
str_repeat(string,repeat)
Parameter Values
| 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 |
Technical Details
| Return Value: | Returns the repeated string |
|---|---|
| PHP Version: | 4+ |