Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Extract email from text

<?php

function extract_emails_from($string){
  preg_match_all("/[._a-zA-Z0-9-]+@[._a-zA-Z0-9-]+/i", $string, $matches);
  return $matches[0];
}

$text = "blah blah blah blah blah blah email2@address.com";

$emails = extract_emails_from($text);

print(implode("
", $emails));

?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Extract #email #text
ADD COMMENT
Topic
Name
6+9 =