jesushax Posted March 25, 2009 Share Posted March 25, 2009 hi all as the title suggests how can i get everything after an @symbol into a variable and remove any spaces someone may have put after domain, also using mysql_real_escape_string does that remove any trailing spaces before inputting them into the db? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/151079-solved-find-everything-after-the-symbol-and-remove-trailing-spaces/ Share on other sites More sharing options...
Brian W Posted March 25, 2009 Share Posted March 25, 2009 <?php list($name, $domain) = explode("@", $email); $domain = mysql_real_escape_string(trim($domain)); $name = mysql_real_escape_string(trim($name));//might as well? ?> trim removes the white space one either side of a string. rtrim() does only the trailing end, ltrim() from the beginning. hope that helps Quote Link to comment https://forums.phpfreaks.com/topic/151079-solved-find-everything-after-the-symbol-and-remove-trailing-spaces/#findComment-793668 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.