Jump to content

Nicos99

Members
  • Posts

    1
  • Joined

  • Last visited

  • Days Won

    1

Nicos99 last won the day on April 23 2022

Nicos99 had the most liked content!

Nicos99's Achievements

Newbie

Newbie (1/7)

1

Reputation

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