Latest web development tutorials

PHP str_repeat () function

PHP String Reference PHP String Reference

Examples

. "" The string is repeated 13 times:

<?php
echo str_repeat(".",13);
?>

Running instance »

Definition and Usage

str_repeat () function to string repeated a specified number of times.


grammar

str_repeat( string,repeat )

参数 描述
string 必需。规定要重复的字符串。
repeat 必需。规定字符串将被重复的次数。必须大于等于 0。

technical details

return value: Returns the repeated string.
PHP version: 4+


PHP String Reference PHP String Reference