Repeating String str_repeat function

str_repeat (input $string, int $multiplier );
$stringRequired : Input string which is to be repeated
$multiplierRequired : Integer , Number of times the input string is to be repeated.
Using str_repeat string function we can repeat a string by a number ( known as multiplier ). Say we want to repeat a string $ for ten times, here is the syntax for the function str_repeat.

Here is one example
echo str_repeat('$',10);
The above command will print $ ten times.

Now let us move to another example. How about printing such a pattern ?


Here is the code for this
echo str_repeat("*",$i);
echo "<br>";

PHP String Functions

Post your comments , suggestion , error , requirements etc here .

We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2021 All rights reserved worldwide Privacy Policy Disclaimer