Gen. partnerAlgotech

PHP function str_repeat()

Repeats string.

|
September 11, 2019

Availability in PHP 4.0

Repeats string.

Parameters

Parameter Data type Default value Note
$input string not String to be repeated
$multiplier int not How many times to repeat

Return values

string

The final repeated string.

echo 'A' . str_repeat('a', 5) . 'hi'; // Aaaaaahoy

Other resources

[Official str-repeat documentation](Official str-repeat documentation)

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.