greenba Posted April 13, 2008 Share Posted April 13, 2008 Hello to everyone, I would like to have only number values in a string from 0 to 9. What I use is: if (ereg ("([0-9]{6,13})", $string_one, $regs)) { echo "OK"; } but even if the string contains + or / - the validation seems to be OK, but I need it to be OK only when there are just numbers, nothing else. Any ideas? thanx Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted April 13, 2008 Share Posted April 13, 2008 Try to use is_int(). Quote Link to comment Share on other sites More sharing options...
greenba Posted April 13, 2008 Author Share Posted April 13, 2008 Thank you. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.