fork download
  1. <?php
  2.  
  3. $regular_exression_filter_integer = '/^[0-9]+\.?$/';
  4.  
  5. $verify = "1.";
  6. if (preg_match ($regular_exression_filter_integer, $verify)) {
  7. echo "clean input";
  8. } else {
  9. echo "bad input";
  10. }
  11. echo "\n";
  12. $verify = "123456";
  13. if (preg_match ($regular_exression_filter_integer, $verify)) {
  14. echo "clean input";
  15. } else {
  16. echo "bad input";
  17. }
  18. echo "\n";
  19. $verify = "1.1";
  20. if (preg_match ($regular_exression_filter_integer, $verify)) {
  21. echo "clean input";
  22. } else {
  23. echo "bad input";
  24. }
  25.  
Success #stdin #stdout 0.03s 52480KB
stdin
Standard input is empty
stdout
clean input
clean input
bad input