- Code: Select all
<?php
$email = "mail@example.com";
if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
//send the email
}
else {
echo "Invalid email address.";
}
?>
<?php
$email = "mail@example.com";
if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email)) {
//send the email
}
else {
echo "Invalid email address.";
}
?>Users browsing this forum: No registered users and 0 guests