Repeating Strings and Characters
Learn how to repeat an input string using the repeat helper method.
We'll cover the following...
The repeat helper method
We can use the repeat helper method to repeat an input string a specified number of times.
Press + to interact
<?php/*** Versions: Laravel 8, 9** @return string*/public static function repeat(string $string,int $times);
As an example, the following code samples would return the value **********:
Press + to interact
<?phpuse Illuminate\Support\Str;Str::repeat('*', 10);(string) str('*')->repeat(10);
The following ...
Ask