Ereg Replace
Posted: Fri Oct 27, 2006 1:58 pm
how do i replace an email address inside a string?
example:
-----------------
$string='this is abc@abc.com and somthing else';
$string = str_replace(ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $speak), '***', $string);
but i dont have the syntax right on the implementation of the ereg.
example:
-----------------
$string='this is abc@abc.com and somthing else';
$string = str_replace(ereg("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $speak), '***', $string);
but i dont have the syntax right on the implementation of the ereg.