Posted by Stefan Rybacki on 10/12/05 13:22
dean wrote:
> hi
> I am having a problem with one of my scripts
> Say if someone posted <a href="mailto: some@email.com">email me</a>
> I wan't it replace with <a
> href="http://www.mydomain.com/scripts.php">email me</a>
>
> I have tried regular expressions but to no avail.
> thanks
but regular expression is exactly what you want.
try something like this in preg_replaceall:
/<a.+href\W*=\W*\"\W*mailto:.*\".*>/
Regards
Stefan
PS: untested but this way you'll get an idea
Navigation:
[Reply to this message]
|