Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP str_repeat() Function

PHP str_repeat() Function

PHP String Reference Manual PHP String Reference Manual

Example

Repeat the string "." 13 times:

Run Example »


Definition and Usage

The str_repeat() function repeats a string a specified number of times.


Syntax

str_repeat(

string,repeat

)

Parameters Description
string Required. Specifies the string to repeat.
repeat Required. Specifies the number of times the string is repeated. Must be greater than or equal to 0.

Technical Details

Return Value: Returns the repeated string.
PHP Version: 4+

PHP String Reference Manual PHP String Reference Manual