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 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 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 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
Archived
This topic is now archived and is closed to further replies.