Link to home
Start Free TrialLog in
Avatar of willsherwood
willsherwood

asked on

PHP simple comparison (validation) question

I have a web form input text field where i want the user to enter a 5 digit zipcode.
What is the best way (in php, not JS) to make sure it's 5 digits 0-9
I've tried  < and > comparisons, but characters evidently get converted to integers and some short strings can fall within the 0-99999 range.

thanks
ASKER CERTIFIED SOLUTION
Avatar of glcummins
glcummins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of willsherwood
willsherwood

ASKER

thanks to you all.  (simultaneously)