예, PHP에서 filter_input()을 AND/OR과 결합하는 것이 가능합니다. 이것은 POST 필드를 반복하여 수행할 수 있습니다-
$value = filter_input(INPUT_POST, 'field', FILTER_DEFAULT, is_array($_POST['field']) ? FILTER_REQUIRE_ARRAY : NULL);
각 루프에 대해 동일한 사용자에 대한 동등한 항목이 아래에 나와 있습니다.
$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});
}
}