str_repeat
-
Repeating a string in Ruby uses the multiplication operator — the
String#*method.PHP
$result = str_repeat("abc", 5); var_export($result); // => 'abcabcabcabcabc'
Ruby
result = "abc" * 5 p result # => "abcabcabcabcabc"
see also
Looking for Rails or PHP web application development, integration, and training?
Rails for PHP is brought to you by Maintainable Software. Get custom web applications and personalized training from the authors of the book and website.

