Reply
Email Address Remover
Old 07-31-2004, 06:48 PM Email Address Remover
Novice Talker

Posts: 7
I make it a habit of not feeding spammers by refusing to publish email addresses on the web. Sometimes, however, it can be very time consuming to remove email addresses when publishing a long document that has a lot of email addresses interspersed in it. (For instance a digest of emails from a listserve)

Does anyone have, know of, or know how to make a script or stand-alone program that will take a file and remove all email addresses for it? I have a general idea how to write one, but I'm a beginnner to PHP. I know it's possible because there are many freeware programs that extract email addresses from documents and save them to a list. This would essentially do the same thing, except instead of saving those addresses to a list, it would simply delete them or replace them with "username@..." (like Yahoo does in there groups website).

If a program like this doesn't already exist, I'll write it myself, but hopefully someone is interested in helping me out along the way. Thanks.
rob guinness is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-01-2004, 05:54 AM
Novice Talker

Posts: 14
Code:
<?php
function strip_email($str) {
	$str = ereg_replace("@.+\.(com|co.uk|net)", "@spam.com", $str);
	echo $str;
}

$text = "This email is the email to filter out: me@something.com";
strip_email($text);
?>
That should filter out all the emails in the document. Have fun
__________________
http://www.blueprog.com <-- For help and discussion with web and computer coding
lotrgamemast is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Email Address Remover
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12830 seconds with 12 queries