Hi everyone.
For a given string, I need to find out if it contains a mailadress, and if it does I need to replace it with soemthing else.
I tryed using preg_match and preg_replace but can't get it to work.
Does anyone have a clue?
Tore
This example should give you some idea
<?php $mail ='This is my email address: me@home.com '; $search = "/(\\S+@\\S+\\.\\w+)/"; $replace = 'EMAIL'; $text = preg_replace($search, $replace, $mail); echo $text; ?>
Thanx a lot ... it works perfect