refiking Posted January 20, 2008 Share Posted January 20, 2008 How can I recognize a space in a username? I am sending out an email which is domain.com/activate.php?user=$username What can I do when the username has a space in it? I know that I need to add %20 in the place of the space. I just need to know how to recognize it so I can change $username before the email goes out Quote Link to comment https://forums.phpfreaks.com/topic/86874-how-to-recognize-a-space/ Share on other sites More sharing options...
Northern Flame Posted January 20, 2008 Share Posted January 20, 2008 preg_replace or str_replace will do the trick Quote Link to comment https://forums.phpfreaks.com/topic/86874-how-to-recognize-a-space/#findComment-444136 Share on other sites More sharing options...
wildteen88 Posted January 20, 2008 Share Posted January 20, 2008 If you are sending the username over the url then use urlencode. This function will convert your string so it is url safe. When you receive the username use urldecode to convert the url-encoded string back to the original Quote Link to comment https://forums.phpfreaks.com/topic/86874-how-to-recognize-a-space/#findComment-444421 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.