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? 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. 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. 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 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. 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 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! 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. 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) Link to comment https://forums.phpfreaks.com/topic/84227-removing-symbols/#findComment-428921 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.