Validate an integer that is 0


SUBMITTED BY: henry1874w

DATE: June 21, 2017, 11:45 p.m.

FORMAT: Text only

SIZE: 260 Bytes

HITS: 223

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <?php
  5. $int = 0;
  6. if (filter_var($int, FILTER_VALIDATE_INT) === 0 || !filter_var($int, FILTER_VALIDATE_INT) === false) {
  7. echo("Integer is valid");
  8. } else {
  9. echo("Integer is not valid");
  10. }
  11. ?>
  12. </body>
  13. </html>

comments powered by Disqus