I am creating a newsletter for my client (full story [URL=”https://webdeveloper.com/forum/showthread.php?t=184620″]here
Here is my verification code:
[code=php]
//Verify email function
function check_email_address($email1) {
if (!ereg(“^[^@]{1,64}@[^@]{1,255}$”, $email1)) {
return false;
}
$email_array = explode(“@”, $email1);
$local_array = explode(“.”, $email_array[0]);
for ($i = 0; $i < sizeof($local_array); $i++) {
if
(!ereg(“^(([A-Za-z0-9!#$%&’*+/=?^_`{|}~-][A-Za-z0-9!#$%&
↪’*+/=?^_`{|}~.-]{0,63})|(“[^(\|”)]{0,62}”))$”,
$local_array[$i])) {
return false;
}
}
if (!ereg(“^[?[0-9.]+]?$”, $email_array[1])) {
$domain_array = explode(“.”, $email_array[1]);
if (sizeof($domain_array) < 2) {
return false;
}
for ($i = 0; $i < sizeof($domain_array); $i++) {
if
(!ereg(“^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|
↪([A-Za-z0-9]+))$”,
$domain_array[$i])) {
return false;
}
}
}
return true;
}
Well its not mine, I grabbed it.
I want something easier, some simplified. Also, I need it for 10 different emails (and I don’t want to have to do this 10 different times) Does anyone have any suggestions?
Thanks.