Função str_repeat() PHP
Exemplo
Repete a string "Shanghai" 5 vezes:
<?php echo str_repeat("Shanghai",5); ?>
Definição e Uso
A função str_repeat() repete a string a quantidade especificada de vezes.
Sintaxe
str_repeat(string,repeat)
Parâmetros | Descrição |
---|---|
string | Obrigatório. Especifica a string a ser repetida. |
repeat | Obrigatório. Especifica o número de vezes que a string será repetida. Deve ser maior ou igual a 0. |
Detalhes Técnicos
Retorno: | Retorna a string repetida. |
Versão PHP: | 4+ |