Dogboys Posted October 13, 2008 Share Posted October 13, 2008 Like so if I was to enter "546s6" through a function or some script that it would return as something saying there is a letter or just something to signify that there is one. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/128146-solved-is-there-a-function-that-checks-for-non-numbers/ Share on other sites More sharing options...
genericnumber1 Posted October 13, 2008 Share Posted October 13, 2008 http://us2.php.net/is_numeric is_numeric() to the rescue! Quote Link to comment https://forums.phpfreaks.com/topic/128146-solved-is-there-a-function-that-checks-for-non-numbers/#findComment-663699 Share on other sites More sharing options...
Zane Posted October 13, 2008 Share Posted October 13, 2008 if(preg_match("/[a-zA-Z]/", "546s6")) echo "There's a letter"; else echo "There ain't one"; EDIT: is_numeric() may be quicker though Quote Link to comment https://forums.phpfreaks.com/topic/128146-solved-is-there-a-function-that-checks-for-non-numbers/#findComment-663700 Share on other sites More sharing options...
Dogboys Posted October 13, 2008 Author Share Posted October 13, 2008 Thank you genericnumber1 as that will work just fine! Thanks zanus, that'll also work! Quote Link to comment https://forums.phpfreaks.com/topic/128146-solved-is-there-a-function-that-checks-for-non-numbers/#findComment-663704 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.