I recently was told there is FILTER_VALIDATE_INT which is great by the way.
My question is in terms of taking an integer value from the website whether it maybe fro
$price = filter_input(INPUT_POST, 'param', FILTER_VALIDATE_INT); if ($price !== false) { print " a number."; //works when value is number } if(is_int($_POST['param'])){ print "is number."; //don't works when value is number }
Please try test with when value is number .