Jump to content

Nicos99

Members
  • Posts

    1
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Nicos99

  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...