PHP str_repeat Function

What is str_repeat Function?


This function is used to repeat a string in PHP.



The syntax specifies the string to be repeated for number of times as given in multiplier

Example :

echo str_repeat("Hscripts",4);
Result :

Hscripts Hscripts Hscripts Hscripts

In the above example the string "Hscripts" is repeated four times

PHP Topics

Ask Questions

Ask Question