/* numeric, decimal passes */ function validate_numeric($variable) { return is_numeric($variable); } /* digits only, no dots */ function is_digits($element) { return !preg_match ("/[^0-9]/", $element); }A customer number, for example, should not have any decimal points but using is_numeric() would let a decimal value pass the test. Don't be this guy!
0 comments:
Post a Comment