Gayner Posted December 2, 2009 Share Posted December 2, 2009 function lnonly($string) { $eregi = eregi_replace("([A-Z0-9]+)","",$string); if(empty($eregi)){ return true; } return false; } So that's only for LEtters and numbers right. But I want to add more available characters. like let's say i want people to use the ₧ code, or maybe a @ Sign, how would i add it so it's usable in that string?very confusing Quote Link to comment https://forums.phpfreaks.com/topic/183680-letters-numbers-and-i-want-to-add-more/ Share on other sites More sharing options...
mikesta707 Posted December 2, 2009 Share Posted December 2, 2009 add the characters to the pattern? "([A-Z0-9@]+)" Quote Link to comment https://forums.phpfreaks.com/topic/183680-letters-numbers-and-i-want-to-add-more/#findComment-969486 Share on other sites More sharing options...
Gayner Posted December 2, 2009 Author Share Posted December 2, 2009 add the characters to the pattern? "([A-Z0-9@]+)" So they can still register with username hey@rofl ? Quote Link to comment https://forums.phpfreaks.com/topic/183680-letters-numbers-and-i-want-to-add-more/#findComment-969488 Share on other sites More sharing options...
mikesta707 Posted December 2, 2009 Share Posted December 2, 2009 $string = "adf9a8sdf__--==..,,''@"; $eregi = preg_replace("([^A-Za-z0-9@]+)","",$string); echo $eregi adf9a8sdf@ [/code] Quote Link to comment https://forums.phpfreaks.com/topic/183680-letters-numbers-and-i-want-to-add-more/#findComment-969493 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.