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

PHP FILTER_SANITIZE_NUMBER_INT Filter

PHP FILTER_SANITIZE_NUMBER_INT Filter


PHP Filter Reference Manual Complete PHP Filter Reference Manual


Definition and Usage

The FILTER_SANITIZE_NUMBER_INT filter removes all illegal characters from a number.

This filter allows all digits as well as . + -


Example

The output of the code is shown below:

string(5) "5-2+3"


PHP Filter Reference Manual Complete PHP Filter Reference Manual