Answers for "how to recognize an string is email in php"

PHP
0

php extract email address from string

<?php 
    $string = 'Ruchika < [email protected] >';
    $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]);
?>
Posted by: Guest on July-22-2021

Code answers related to "how to recognize an string is email in php"

Browse Popular Code Answers by Language