I want to extract email address from html source.
i was using below to code to extract the email address in the format mail@domain.com
function extract_email_address ($string) {
foreach(preg_split('/\s/', $string) as $token) {
$email = filter_var(filter_var($token, FILTER_SANITIZE_EMAIL), FILTER_VALIDATE_EMAIL);
if ($email !== false) {
$emails[] = $email;
}
}
return $emails;
}
Now, it looks like the email is protected with []
symbol, the email address looks like
mail[@]domain.com
, (Notice the @
symbol withing []
). So, the above code did not help.
anybody knows answer for this question?