Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php extract email address from string

<?php 
    $string = 'Ruchika < ruchika@example.com >';
    $pattern = '/[a-z0-9_-+.]+@[a-z0-9-]+.([a-z]{2,4})(?:.[a-z]{2})?/i';
    preg_match_all($pattern, $string, $matches);
    var_dump($matches[0]);
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #php #extract #email #address #string
ADD COMMENT
Topic
Name
7+6 =