📜  laravel 集合拒绝 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:47.896000             🧑  作者: Mango

代码示例1
$collection = collect([1, 2, 3, 4]);

$filtered = $collection->reject(function ($value, $key) {
    return $value > 2;
});

$filtered->all();

// [1, 2]