filter_var

I am not sure if I am using the filter_var command correctly. Regardless of what $src_term is it always sees the statement as false. Can anyone see where I am going wrong with this?



$filter="FILTER_VALIDATE_INT";
$error="Bad!";
$src_term = "aaaaaaaaaaaaaa";
	
if (filter_var($src_term, $filter) == FALSE)
	{
			echo htmlspecialchars($error, ENT_QUOTES, 'UTF-8');
			exit();
	}
	else{
		echo "good";	
	}

The filter should be one of the filter constants, not a string.


$filter = FILTER_VALIDATE_INT;

Excellent … thank you very much