Laravel 8 replaceArray {#collection-method}
2021-07-19 10:34 更新
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
以上内容是否对您有帮助:
更多建议: