$array = [1, 2, 3, 4, 5]; $filtered = array_filter($array, function($item) { return $item != 4; // Return (include) current item if expression is truthy }); // $filtered = [1, 2, 3, 5]