McMaster Posted April 23, 2010 Share Posted April 23, 2010 Hi, I have a textarea on my website where users can input text. I don't want them to post email addresses so if they enter an email address it will be replaced with (email removed) How do I go about doing this? Any help appreciated. Link to comment https://forums.phpfreaks.com/topic/199517-replacing-an-email-in-text/ Share on other sites More sharing options...
Ken2k7 Posted April 23, 2010 Share Posted April 23, 2010 Use a regular expression replacement function like preg_replace. Link to comment https://forums.phpfreaks.com/topic/199517-replacing-an-email-in-text/#findComment-1047182 Share on other sites More sharing options...
McMaster Posted April 23, 2010 Author Share Posted April 23, 2010 Would you be kind enough to tell me how to go about doing that? I find regular expressions complicated lol. Link to comment https://forums.phpfreaks.com/topic/199517-replacing-an-email-in-text/#findComment-1047186 Share on other sites More sharing options...
Ken2k7 Posted April 23, 2010 Share Posted April 23, 2010 Ever used Google? You can easily Google up a regular expression for an email address. Link to comment https://forums.phpfreaks.com/topic/199517-replacing-an-email-in-text/#findComment-1047190 Share on other sites More sharing options...
McMaster Posted April 23, 2010 Author Share Posted April 23, 2010 I thought this forum was for helping people out :S Everyone knows Google, that is just insulting lol. Link to comment https://forums.phpfreaks.com/topic/199517-replacing-an-email-in-text/#findComment-1047192 Share on other sites More sharing options...
Ken2k7 Posted April 23, 2010 Share Posted April 23, 2010 haha... an insult to you or Google? Because apparently, you either forgot about Google or don't know how to use it. Nah, this forum is for help, but it's not a request for code forum. You asked a question and I answered it. If you actually have trouble with something with preg_replace or having a hard time finding the regular expression on Google, then I can help further. Having provided nothing and given no effort to finding the solution yourself, there's not much help I would offer. You expect us to do all the work and you cruise along? We're not being paid for that. lol Link to comment https://forums.phpfreaks.com/topic/199517-replacing-an-email-in-text/#findComment-1047199 Share on other sites More sharing options...
ChemicalBliss Posted April 23, 2010 Share Posted April 23, 2010 We're not being paid full stop. This forum is for php coding help, learning regular expressions has quite a steep learning curve. Common subjects like this can be found via the forum search button (which you should of used first - forum rules). Most subjects however are covered in tutorials and guides on website found using google. I would say this forum is for something you cannot find or understand in those tutorials. Webpages dedicated to this the specific topic, will have much more detailed and relevant information. And everyone who helps you on here is taking time away from their own activities, solely to answer our questions, for free, with no reward whatsoever, be curteious and says thank you when they give an answer you can use. fyi: www.lmgtfy.com/?q=email+regular+expressions -cb- Link to comment https://forums.phpfreaks.com/topic/199517-replacing-an-email-in-text/#findComment-1047212 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.