Laravel 8 replaceArray {#collection-method}
replaceArray
方法按照数组顺序使用其值替换字符串的指定部分:
use Illuminate\Support\Str;
$string = 'The event will take place between ? and ?';
$replaced = Str::of($string)->replaceArray('?', ['8:30', '9:00']);
// The event will take place between 8:30 and 9:00