Current Location: Home> Function Categories> str_repeat

str_repeat

Repeat a string
Name:str_repeat
Category:String
Programming Language:php
One-line Description:Repeat the string as specified number of times.

Definition and usage

str_repeat() function repeats the string as specified.

Example

Repeat the string "Shanghai" 5 times:

 <?php
echo str_repeat ( "Shanghai" , 5 ) ;
?>

Try it yourself

grammar

 str_repeat ( string , repeat )
parameter describe
string Required. Specifies the string to be repeated.
repeat Required. Specifies the number of times the string will be repeated. Must be greater than or equal to 0.
Similar Functions
Popular Articles