enovativ Posted April 8, 2007 Share Posted April 8, 2007 Can PHP be used to extract email addresses from a web page, put them in comma-delimited format ? If so, how can this be done using PHP ? Link to comment https://forums.phpfreaks.com/topic/46116-php-email-addresses/ Share on other sites More sharing options...
metrostars Posted April 8, 2007 Share Posted April 8, 2007 Yees it is possible, can you sho us the format of the website? eg. how it i laid out. Link to comment https://forums.phpfreaks.com/topic/46116-php-email-addresses/#findComment-224085 Share on other sites More sharing options...
enovativ Posted April 8, 2007 Author Share Posted April 8, 2007 here is the website http://www.socalmsbl.com/info/joinList.ihtml?form=21987 login: TEMP pass: temp Link to comment https://forums.phpfreaks.com/topic/46116-php-email-addresses/#findComment-224087 Share on other sites More sharing options...
obsidian Posted April 8, 2007 Share Posted April 8, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.