Answers for "get email with preg grep php"

PHP
0

get email with preg grep php

<?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 February-07-2022
0

get email with preg grep php

<?php 
    $text = 'Ruchika < [email protected] >';
    preg_match_all("/[._a-zA-Z0-9-]+@[._a-zA-Z0-9-]+/i", $text, $matches);
    print_r($matches[0]);
?>
Posted by: Guest on February-07-2022

Browse Popular Code Answers by Language