Validate an integer


SUBMITTED BY: henry1874w

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

FORMAT: Text only

SIZE: 215 Bytes

HITS: 236

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <?php
  5. $int = 100;
  6. if (!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