PHP string function str_repeat

The String function strpos() repeats a string for a specified number of times.

Syntax

Parameter Description
mystr This is a required parameter which defines the string to repeat.
multiplier This is a required parameter which defines the number of times the string will be repeated and the number should be >=0

Return Value

It will return the string after repeating it for the number of times specified in the multiplier parameter.

Example

PHP Version: PHP 4, PHP 5, PHP 7