Jump to content

[SOLVED] find everything after the @symbol and remove trailing spaces


jesushax

Recommended Posts

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

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.