im not good at regular expressions so i have to make do without :-/
(anyone knows a good tutorial on these please let us know)
this example assumes that the email address is passed as $email
<?
if(strstr(strstr($email, "@"), "."))
{
// email has @ and afterwards has a '.'
}
else
{
// code does not contain '@' followed by '.'
}
?>
there are more involved ways of doing this but this does what you asked 🙂
strstr returns part of a string starting with the first occurence of another string -
strstr("hello there", "llo") will return "llo there"
the important thing to note is that if the string being looked for does not occur this will return B[/B]
hope this helps.
vincent fleetwood
http://www.bodev.com/