Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 7
Trades: 0
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
 
 
Register now for full access!
Old 08-01-2004, 06:54 AM
Novice Talker

Posts: 14
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE
<-- 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 Search this Thread
Search this Thread:

Advanced Search

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

BB 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.09797 seconds with 12 queries