Có, có thể kết hợp filter_input () với AND / OR trong PHP. Điều này có thể được thực hiện bằng cách lặp qua các trường POST−
$value = filter_input(INPUT_POST, 'field', FILTER_DEFAULT, is_array($_POST['field']) ? FILTER_REQUIRE_ARRAY : NULL);
Một tương đương cho cùng một người dùng cho mỗi vòng lặp đã được hiển thị bên dưới−
$memory = array();
//looping through all posted values
foreach($_POST as $key => $value) {
//applying a filter for the array
if(is_array($value)) {
$ memory [$key] = filter_input(INPUT_POST, $key, {filters for array});
}
else {
$ memory [$key] = filter_input(INPUT_POST, $key, {filters for scalar});
}
}