I want to be able to validate form input for usernames. Basically eliminate all illegal characters that are not allowed in standard e-mail addresses before the @ sign.
I.e. only A-Z, a-z, 0-9, and - and _.
Thanks for your help 🙂
look at: http://www.php.net/manual/en/function.ereg.php
in the 'User Contributed Notes' there is much to be found on validating emailaddresses.
greetings.
Check out ereg() and eregi() in the manual.
I figured it out -- sorry I posted. Haha.
For all those who are wondering how I did it or were as clueless as I was 15 minutes ago:
I'm basically doing a:
if(preg_match("/[\w]/", $username))
Thanks to all who responded.