I have recently started user signups on my website, but i have a problem! People can use spaces in there usernames!!!!!
how can i avoid this? is there a special function? i don't want to use the string replace function because then the user wouldn't know that their username had been changed!
You can simply check the usernames with the ereg(i) function:
if (!eregi("[A-Za-z0-9$", $username)) { echo "Invalid chars!"; }
For more info about regular expressions take a look at php.net/regex