Jump to content

PHP + EMAIL ADDRESSES


enovativ

Recommended Posts

If you have the content of the page (source), and you're wanting to pull all the email addresses from the content of the page, I would suggest something like this:

<?php
$page = preg_replace('|<[^>]+>|', ' ', $page); // replace all HTML tags with spaces
preg_match_all('|\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b|i', $page, $matches); // match all email addresses
print_r($matches); // view your results
?>

 

This will most likely need some tweaking for your case, but the principle is there. Good luck!

Link to comment
https://forums.phpfreaks.com/topic/46116-php-email-addresses/#findComment-224108
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.