<a name='form'/><?php
$flags = array( 'FILTER_FLAG_ALLOW_OCTAL', 'FILTER_FLAG_ALLOW_HEX' );
$filter = FILTER_VALIDATE_INT;
?>
<form action="" method="get">
data: <input type="text" name="data" maxlength="64" size="64"/>
<table>
<?php foreach( $flags as $flagName ) {
echo "<tr><td>$flagName</td><td><input type='checkbox' name='$flagName'/></td></tr>";
} ?>
</table>
Min: <input type="text" name="min"/><br/>Max: <input type="text" name="max"/>
<input type="submit"/>
</form>
<?php
if (!empty($_GET['min']))
$options['options']['min_range'] = (int) $_GET['min'];
if (!empty($_GET['max']))
$options['options']['max_range'] = (int) $_GET['max'];
if (isset($_GET['data'])) {
$o = 0;
foreach( $flags as $flagName )
if ( isset( $_GET[$flagName] ) )
$o |= constant( $flagName );
$options['flags'] = $o;
$data = filter_input( INPUT_GET, 'data', $filter, $options );
var_dump( $data );
}
?>
Output