How to repeat a string to a specific number of times in php?
In PHP, the
str_repeat() function, which is inbuilt is used to repeat a string for a specific number of times. This str_repeat() function creates new strings by repeating the given string ‘n’ number of times as specified.
Here is the syntax of the str_repeat() function:
Here is an example demonstrating the same:
echo str_repeat("BIQ ", 2);
Suggest An Answer