Why is this expression used in the tutorial? in PHP Posted October 9, 2019 In the lesson on PHP Filters in the code sample "Validate an Integer" there is the following code: <?php $int = 100; if (!filter_var($int, FILTER_VALIDATE_INT) === false) { echo("Integer is valid"); } else { echo("Integer is not valid"); } ?> Why use this expression: (!filter_var($int, FILTER_VALIDATE_INT) === false) instead of what seems to me to be the more logical expression?: (filter_var($int, FILTER_VALIDATE_INT) === true) Thanks.
Why is this expression used in the tutorial?
in PHP
Posted
In the lesson on PHP Filters in the code sample "Validate an Integer" there is the following code:
Why use this expression:
instead of what seems to me to be the more logical expression?:
(filter_var($int, FILTER_VALIDATE_INT) === true)
Thanks.