FILTER_SANITIZE_NUMBER_INT filter removes all illegal characters from numbers.
This filter allows all numbers as well. + -
Name: "number_int"
ID-number: 519
<?php$number="5-2+3pp";var_dump(filter_var($number, FILTER_SANITIZE_NUMBER_INT));?>
The output of the code looks like this:
string(5) "5-2+3"