I would like to know how to match certain emails (with requiered domainames) an exaple;
I would like to extract all email with the ending ".es" or ".pt", ".com.mx" etc... I've coded a little script to filter some emails; "hotmail.com", "aol.com", "gmail.com"...
<?php
$emails = $_POST['emails'];
$ex = explode("
", $emails);
$count = count($ex);
if (isset($emails) && $count >= 1) {
echo "<center><font color = 'red'><b>$count </font>Number of emails </b></center><br />";
} else {
echo "<center>
No email </center>";
exit;
}
if (isset($emails)) {
for ($i = 0; $i <= $count; $i++) {
$d = strtolower($ex[$i]);
if (strstr($d, "@hotmail") || strstr($d, "@live") || strstr($d, "@msn") || strstr($d, "@outlook")) {
$hotmail .= $d;
$nh = $nh + 1;
} else {
if (strstr($d, "@yahoo") || strstr($d, "@ymail")) {
$yahoo .= $d;
$ny = $ny + 1;
}
}
?>