I have this chunk of code:
$range = array (
'options' => array (
'min_range' => 0,
'max_range' => 10
)
);
if (!$number = filter_input(INPUT_POST, 'number', FILTER_VALIDATE_INT, $range)) {
exit ('Error');
}
The "number" input will be sent from a with options from 0 to 10.
the problem is that if number = 0 this returns "Error".
What's wrong with that?
Thanks
$numberand then you negate that result converting it to boolean (it could have been boolean, int or NULL).