Page 1 of 1

Ereg Replace

Posted: Fri Oct 27, 2006 1:58 pm
by amir
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.

Posted: Fri Oct 27, 2006 1:59 pm
by feyd