helloworld001 Posted February 22, 2015 Share Posted February 22, 2015 I have a register form where a user enters a full name, email and password. I do not want to give them the option of choosing their own "username"; rather I want to automatically create the username from their "full name". So far I can create the username by removing space and symbols from full name. Like this. $fullname = trim($_GET['fullname']); $username = preg_replace('/\s+/', '', $fullname); Looking at that, John Smith would become "johnsmith". Since there could be dozens of people with the name "john smith", I was thinking of assigning unique number to each of them. Like this "johnsmith1", "johnsmith2", "johnsmith3"..etc. How would you say I go on incrementing the username like that? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.