Laravel 8 words {#collection-method}
2021-07-19 10:35 更新
words
方法用于限制字符串中的单词数:
use Illuminate\Support\Str;
$string = Str::of('Perfectly balanced, as all things should be.')->words(3, ' >>>');
// Perfectly balanced, as >>>
以上内容是否对您有帮助:
更多建议: