You are here: Re: replacing mailto links « All PHP « IT news, forums, messages
Re: replacing mailto links

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация