(PHP 4, PHP 5, PHP 7, PHP 8)
str_repeat — Ripete una stringa
Restituisce il parametro input_str
ripetuto tante volte quanto indicato
in multiplier
.
multiplier
deve essere maggiore o uguale a 0.
Se multiplier
è impostato a zero, la funzione
restituisce una stringa vuota.
Example #1 Esempio di uso di str_repeat()
<?php
echo str_repeat("-=", 10);
?>
Il precedente esempio visualizzerà:
-=-=-=-=-=-=-=-=-=-=
Vedere anche for, str_pad() e substr_count().