多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
## chunkWhile 方法根据指定的回调值把集合分解成多个更小的集合: ``` $collection = collect(str_split('AABBCCCD')); $chunks = $collection->chunkWhile(function ($current, $key, $chunk) { return $current === $chunk->last(); }); $chunks->all(); // [['A', 'A'], ['B', 'B'], ['C', 'C', 'C'], ['D']] ```