Asheeown Posted January 3, 2008 Share Posted January 3, 2008 I am making a registration system, the user names cannot have numbers or any symbols of any kind, I guess accents are hard to catch so I don't care about that, no spaces, any ideas on how I can do this? Quote Link to comment https://forums.phpfreaks.com/topic/84227-removing-symbols/ Share on other sites More sharing options...
dewey_witt Posted January 3, 2008 Share Posted January 3, 2008 Check out the ereg() function. Quote Link to comment https://forums.phpfreaks.com/topic/84227-removing-symbols/#findComment-428905 Share on other sites More sharing options...
Asheeown Posted January 3, 2008 Author Share Posted January 3, 2008 I don't understand what terms I would be using with the function. Quote Link to comment https://forums.phpfreaks.com/topic/84227-removing-symbols/#findComment-428906 Share on other sites More sharing options...
dewey_witt Posted January 3, 2008 Share Posted January 3, 2008 This may help you then ==>http://us.php.net/ereg Quote Link to comment https://forums.phpfreaks.com/topic/84227-removing-symbols/#findComment-428909 Share on other sites More sharing options...
Asheeown Posted January 3, 2008 Author Share Posted January 3, 2008 Yes I've been to that I dont even know how many times already tonight. No one is really explaining it, they just throw a bunch of symbols into their string with no explanation. Quote Link to comment https://forums.phpfreaks.com/topic/84227-removing-symbols/#findComment-428913 Share on other sites More sharing options...
teng84 Posted January 3, 2008 Share Posted January 3, 2008 NO NEED FOR REGEX if you only need alph then use ctype_alpha(stringhere) returns true of flase Quote Link to comment https://forums.phpfreaks.com/topic/84227-removing-symbols/#findComment-428917 Share on other sites More sharing options...
dewey_witt Posted January 3, 2008 Share Posted January 3, 2008 teng is so dang knowledgfull. That solution didnt even come to mind. Awsome! Quote Link to comment https://forums.phpfreaks.com/topic/84227-removing-symbols/#findComment-428918 Share on other sites More sharing options...
Asheeown Posted January 3, 2008 Author Share Posted January 3, 2008 That's exactly what I was looking for, but does it check for spaces too? Can't have those either. Quote Link to comment https://forums.phpfreaks.com/topic/84227-removing-symbols/#findComment-428920 Share on other sites More sharing options...
teng84 Posted January 3, 2008 Share Posted January 3, 2008 var_dump(ctype_alpha('teng hre')); var_dump(ctype_alpha('teng5645')); var_dump(ctype_alpha('teng&&^')); var_dump(ctype_alpha('teng')); result bool(false) bool(false) bool(false) bool(true) Quote Link to comment https://forums.phpfreaks.com/topic/84227-removing-symbols/#findComment-428921 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.