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"; } Link to comment https://forums.phpfreaks.com/topic/53466-solved-string-with-only-numbers/ 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 { } Link to comment https://forums.phpfreaks.com/topic/53466-solved-string-with-only-numbers/#findComment-264251 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.