Laravel 8 mode() {#collection-method}
2021-07-19 09:42 更新
The mode
方法返回指定键的 众数:
$mode = collect([['foo' => 10], ['foo' => 10], ['foo' => 20], ['foo' => 40]])->mode('foo');
// [10]
$mode = collect([1, 1, 2, 4])->mode();
// [1]
以上内容是否对您有帮助:
更多建议: