阅读(3401) (7)

Laravel 8 split {#collection-method}

2021-07-05 09:43:53 更新

split 方法使用正则表达式将字符串分割到集合中:

use IlluminateSupportStr;

$segments = Str::of('one, two, three')->split('/[s,]+/');

// collect(["one", "two", "three"])