阅读(4445) (12)

Laravel 8 Str::replaceLast() {#collection-method}

2021-07-15 14:39:51 更新

Str::replaceLast 函数替换字符串中最后一次出现的给定值:

use IlluminateSupportStr;

$replaced = Str::replaceLast('the', 'a', 'the quick brown fox jumps over the lazy dog');

// the quick brown fox jumps over a lazy dog