devWhiz Posted August 5, 2011 Share Posted August 5, 2011 I have a huge list of emails in a text file in this format [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], I need a script to read the list and make a new list only including the yahoo, ymail or rocketmail email address in the format like this [email protected] [email protected] [email protected] [email protected] [email protected] so it would just need to remove all of the emails from the list that are not yahoo, rocketmail or ymail as well as the commas and put them in another text in the above format, if anyone is able to help me out with this is would be appreciated! thanks! Link to comment https://forums.phpfreaks.com/topic/243901-script-to-read-text-and-remove-certain-emails/ Share on other sites More sharing options...
devWhiz Posted August 5, 2011 Author Share Posted August 5, 2011 so say I have this list in the file [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected] after running the script, the output file should look like this [email protected] [email protected] [email protected] [email protected] script would remove [email protected], [email protected], [email protected] is this possible? Link to comment https://forums.phpfreaks.com/topic/243901-script-to-read-text-and-remove-certain-emails/#findComment-1252407 Share on other sites More sharing options...
WebStyles Posted August 5, 2011 Share Posted August 5, 2011 use file_get_contents to load the file. explode to seperate the emails into an array, and a foreach loop to remove the ones you don't want. Link to comment https://forums.phpfreaks.com/topic/243901-script-to-read-text-and-remove-certain-emails/#findComment-1252523 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.