(PHP 4, PHP 5, PHP 7, PHP 8)
str_repeat — Repite un string
Retorna el string string repetido
times veces.
stringEl string a repetir.
times
Número de veces que el string string
debe ser multiplicado.
times debe ser positivo o nulo.
Si times es 0, la función retorna
el string vacío.
Retorna el string, repetido times veces.
Ejemplo #1 Ejemplo con str_repeat()
<?php
echo str_repeat("-=", 10);
?>El ejemplo anterior mostrará :
-=-=-=-=-=-=-=-=-=-=