I was able to achieve this by using the get_defined_constants() PHP built-in function, which list all predefined PHP constants.
Solution:
The code below will store all the allowed filters into an array and allow you to check any filter's validity via the check_filter() function.
<?php
$constants = get_defined_constants();
$allowed_filters = array();
foreach ($constants as $c => $val)
if (substr($c, 0, 7) == 'FILTER_')
$allowed_filters[$c] = 1;
function check_filter($filter_name, $allowed_filters) { return isset($allowed_filters[$filter_name]); }
var_dump(check_filter('FILTER_SANITIZE_EMAIL', $allowed_filters)); // true
var_dump(check_filter('FILTER_TEST', $allowed_filters)); // false
var_dump(check_filter('PHP_VERSION', $allowed_filters)); // false, even though constant exists
I hope this helps!