Hello,
when a new user joins up at my site i want to check to make sure there username isnt to long, i am currently using this.
if(!eregi("[0-9a-z]{4,10}$", $username)) {
print "bad input\n";
}
else{
print "good input\n";
}
this works fine, it checks to make sure the username is atleast 4 letters and numbers long, and checks for unwanted characters, but what it isnt doing is checking to make sure the username isnt longer then 10 chars.
How can i check this?
Best Wishes
ryza