阅读(3392)
赞(2)
Laravel 8 split {#collection-method}
2021-07-05 09:43:53 更新
split 方法使用正则表达式将字符串分割到集合中:
use Illuminate\Support\Str;
$segments = Str::of('one, two, three')->split('/[\s,]+/');
// collect(["one", "two", "three"]) split 方法使用正则表达式将字符串分割到集合中:
use Illuminate\Support\Str;
$segments = Str::of('one, two, three')->split('/[\s,]+/');
// collect(["one", "two", "three"]) Copyright©2023 字节宝字节宝| |
违法和不良信息举报电话:|举报邮箱:3111859717@qq.com
