Reputation: 11448
Say I have a number=20
and a $value=7
.
If I want to make a string of 20 7's using PHP. what's the quickest way to make this?
So output like:
$a='77777777777777777777';
Any functions to make this easier?
Upvotes: 30
Views: 13677
Reputation: 88667
$a = str_repeat('7', 20);
...or maybe:
$a = str_pad('', 20, '7');
Upvotes: 4