Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Nicos99

  • Rank
  1. I think the correct way is to do the check is this way : if (!(filter_var($int, FILTER_VALIDATE_INT) === false)) { echo("Integer is valid"); } else { echo("Integer is not valid"); } Because the rule is that `filter_var' return bool(false) only if there is an invalid integer, else return int(the value). And we test "!(fnc === false)" because the `!`operator take precedence over `===` otherwise. More over hese is no integer zero problem anymore ==> What do you think of that ?
  • Create New...