jaymc Posted May 2, 2007 Share Posted May 2, 2007 How can I check of a string containts a number Quote Link to comment Share on other sites More sharing options...
trq Posted May 2, 2007 Share Posted May 2, 2007 <?php $s = "this is a string with the number 24 in it"; if (preg_match('.[0-9].',$s)) { echo '$s contained a number'; } ?> Quote Link to comment Share on other sites More sharing options...
jaymc Posted May 2, 2007 Author Share Posted May 2, 2007 Cheers 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.