Home and Learn: PHP Programming Course

The PHP str_repeat() function


Repeats a character a specified number of times. If you want nine dollar signs, for example, then you'd use the str_repeat() function like this:

$extra_dollars = str_repeat( "$", 9 );
print $extra_dollars;

<-- Back One Page | Move on to the Next Part -->

Back to the PHP Contents Page

Email us: enquiry at homeandlearn.co.uk