This is the one filter_* function that doesn’t involve any of the filters. It merely checks if an input variable exists. Think of it as isset() on an input type.

It’s different than doing isset( $_POST['var'] ) for example, because - as is the case with filter_input() - it checks the actual input and not our superglobals.

Again, let’s assume a form had the following input elements:

<input type="hidden" name="name" value="Robert Purcell">
<input type="hidden" name="url" value="http://phpnightly.căom">
<input type="hidden" name="id" value="24601">
$ok = filter_has_var( INPUT_POST, 'name' );   // true
$ok = filter_has_var( INPUT_POST, 'monkey' ); // false
 
$_POST['monkey'] = 'apple';
$ok = filter_has_var( INPUT_POST, 'monkey' ); // false