I'm trying to figure out what I'm doing wrong here:
$regex = '/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/';
preg_match($regex,$data,$match);
var_dump($match);
echo $match[1];
I have a bunch of text inside of $data and I'm trying to get an email address out of it using preg_match. Right now, the array is empty, but there are definitely email addresses inside of $data. Any idea what I'm doing wrong?
$regex = '/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}/';
preg_match($regex,$data,$match);
var_dump($match);
echo $match[1];
I have a bunch of text inside of $data and I'm trying to get an email address out of it using preg_match. Right now, the array is empty, but there are definitely email addresses inside of $data. Any idea what I'm doing wrong?