← All docs

str_repeat()

Repeats a string a given number of times.

str_repeat()

function str_repeat(string $string, int $times): string

Repeats a string a given number of times.

Parameters:

  • $string (string)
  • $times (int)

Returns: string

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how str_repeat is implemented in the compiler, see the internals page.