Função PHP str_repeat()
Exemplo
Repita a sequência "Uau" 13 vezes:
<?php
echo str_repeat("Wow",13);
?>
Definição e uso
A função str_repeat() repete uma string um número especificado de vezes.
Sintaxe
str_repeat(string,repeat)
Valores de parâmetro
Parameter | Description |
---|---|
string | Required. Specifies the string to repeat |
repeat | Required. Specifies the number of times the string will be repeated. Must be greater or equal to 0 |
Detalhes técnicos
Valor de retorno: | Retorna a string repetida |
---|---|
Versão do PHP: | 4+ |
❮ Referência de String PHP