Introduction:
Returns input_str repeated multiplier times. multiplier has to be greater than or equal to 0. If the multiplier is set to 0, the function will return an empty string.
string str_repeat ( string input, int multiplier )
Example:
str_repeat() example:
echo str_repeat("-",20);
echo('<br>');
echo str_repeat("==",20);
echo('<br>');
echo str_repeat("=*=",15);
The above example will output:
--------------------
========================================
=*==*==*==*==*==*==*==*==*==*==*==*==*==*==*=
Was this information useful? What other tips would you like to read about in the future? Share your comments, feedback and experiences with us by commenting below!
You might also like...
String encoding and decoding functions in php: Day#5
Md Mahbub Alam Khan is the Editor and Founder of CoolAJAX Web Blog. You can follow CoolAJAX on Twitter , on Facebook or you can subscribe via RSS .
Topics