str_repeat

(PHP 4, PHP 5, PHP 7)

str_repeatRepeat a string

Descrierea

str_repeat ( string $string , int $times ) : string

Returns string repeated times times.

Parametri

string

The string to be repeated.

times

Number of time the string string should be repeated.

times has to be greater than or equal to 0. If the times is set to 0, the function will return an empty string.

Valorile întoarse

Returns the repeated string.

Exemple

Example #1 str_repeat() example

<?php
echo str_repeat("-="10);
?>

Exemplul de mai sus va afișa:

-=-=-=-=-=-=-=-=-=-=

A se vedea și