Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP FILTER_VALIDATE_INT Filter

PHP FILTER_VALIDATE_INT Filter


PHP Filter Reference Manual Complete PHP Filter Reference Manual


Definition and Usage

The FILTER_VALIDATE_INT filter validates a value as an integer.

Possible options or flags:


Tips and Notes

**Note:** When specifying options in an array, the options must be stored in an associative multidimensional array named "options". See the example below.


Example

array("min_range"=>0, "max_range"=>256)); var_dump(filter_var($var, FILTER_VALIDATE_INT, $int_options)); ?>

The output of the code is shown below:

bool(false)


PHP Filter Reference Manual Complete PHP Filter Reference Manual