I need to validate an input string - it must be 9 numbers only and only numeric, no spaces or other characters.
I am able to evaluate the length of it by doing:
strlen($string) == 9
How do I valiadate against the other criteria?
... [man]is_numeric[/man]
If you want a string of only digit characters, "ctype_digit()" will work better since "is_numeric()" allows a few other characters ("+","-", "e", "x", ".", " ").
After a bit more contemplation I realized I did not even need to do this any way. Later in my script I use the values to do checksum, so if someone enters other chars the sum will be incorrect and it'll get FALSE anyway.
Thanks for the tips though!