moisesbr Posted January 29, 2014 Share Posted January 29, 2014 Hi I need to program as follow: If a variable contains more than 3 numbers (as ACD 9455) say "too many numbers" If a variable has no number (as ACD JK) say "no number" Moises Quote Link to comment https://forums.phpfreaks.com/topic/285760-numeric-field/ Share on other sites More sharing options...
requinix Posted January 29, 2014 Share Posted January 29, 2014 What have you tried so far? Quote Link to comment https://forums.phpfreaks.com/topic/285760-numeric-field/#findComment-1466909 Share on other sites More sharing options...
moisesbr Posted January 29, 2014 Author Share Posted January 29, 2014 I will try the solution below. return preg_match_all( "/[0-9]/", $str ); and will let you know if I cannot achieve it. Moises Quote Link to comment https://forums.phpfreaks.com/topic/285760-numeric-field/#findComment-1466913 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.