npsari Posted December 24, 2007 Share Posted December 24, 2007 I am trying to create an if fucntion which will tell me if a string is a number or a letter only i dont want anything else, not even spaces $string = "Anything here"; if($string = [b]pattern[/b]) { print"Wrong"; } else { print"Right"; } Can you tell me how to do it please can you tell me the Pattern Quote Link to comment https://forums.phpfreaks.com/topic/83066-solved-string-contains-only-letters-and-numbers/ Share on other sites More sharing options...
revraz Posted December 24, 2007 Share Posted December 24, 2007 http://us.php.net/ctype_alnum Quote Link to comment https://forums.phpfreaks.com/topic/83066-solved-string-contains-only-letters-and-numbers/#findComment-422550 Share on other sites More sharing options...
npsari Posted December 24, 2007 Author Share Posted December 24, 2007 Thanks much for the link Quote Link to comment https://forums.phpfreaks.com/topic/83066-solved-string-contains-only-letters-and-numbers/#findComment-422565 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.