papaface Posted September 26, 2007 Share Posted September 26, 2007 Hello, How do I check if a string contains letters only. So the string should only contain normal letters such as a b c d, and not letters like é á ú ó etc? regards Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted September 26, 2007 Share Posted September 26, 2007 You'll want regular expressions: <?php $str = 'é'; if(!eregi('^[A-Z]+$',$str)){ echo 'bad string'; }else{ echo 'good string'; } ?> Quote Link to comment Share on other sites More sharing options...
papaface Posted September 26, 2007 Author Share Posted September 26, 2007 Thanks, works 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.