PHP str_repeat() Function Example

PHP Script:

<?php
echo str_repeat(“:.:”,10);
?>

Output:

:.::.::.::.::.::.::.::.::.::.:

Description:

str_repeat() function repeats the string to a specified number of times.

str_repeat function parameters:

1- String: string to repeat.
2- Repeat: Specify how many times the above string to repeat [0 or more].

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s