FILTER_VALIDATE_INT filter validates values as integers.
Name: "int"
ID-number: 257
Possible options or flags:
min_range - specifies the minimum integer value
max_range - specifies the maximum integer value
FILTER_FLAG_ALLOW_OCTAL - allow octal values
FILTER_FLAG_ALLOW_HEX - allows hexadecimal values
Note: When options are specified in an array, the options must be stored in an associative multidimensional array named "options". See examples below.
<?php$var=300;$int_options = array("options"=>array("min_range"=>0, "max_range"=>256));var_dump(filter_var($var, FILTER_VALIDATE_INT, $int_options)); ?>
The output of the code looks like this:
bool(false)