PHP - str_repeat
Trieda
Metóda - str_repeat
(PHP 4, PHP 5, PHP 7)
The str_repeat() function returns a given string repeated
multiple times.
Procedurálne
- function str_repeat (string $input, int $multiplier) : string
Parametre
| Názov | Dátový typ | Predvolená hodnota | Popis |
|---|---|---|---|
| $input | string | A string for repeating. | |
| $multiplier | int | The number specifying how many times to repeat the given string. It must be
greater than or equal to |
Mávratovej hodnoty
Vracia: string
Returns a string repeated multiple times.
Príklady
<?php
echo str_repeat("Hello world!<br />", 5);
echo str_repeat("This string will be never repeated", 0);
Súvisiace manuály
- function str_pad (int $pad_length, string $pad_string = ) : string
