virtuexru Posted May 29, 2007 Share Posted May 29, 2007 How do I check if a string contains only numbers, would this be correct? if (preg_match('/[^0-9"]/', $keyword)) { echo "numbers"; } Quote Link to comment Share on other sites More sharing options...
virtuexru Posted May 29, 2007 Author Share Posted May 29, 2007 Nevermind, solved it: if(!ctype_digit($keyword)) { } else { } 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.