Reply to Re: modifying link tags.

Your name:

Reply:


Posted by Janwillem Borleffs on 11/03/88 11:54

elliott.linux@gmail.com wrote:
> ok what i need to do is modify all the link tags in a string from <a
> href="blah.html"> to <a href="clicktrough.php?uri=blah.html> but the
> problem is some of the tags have class so <a class="llama"
> href="blah.html"> but i dont want to change all of the tags that
> contain "href" because that would mess with the css.
>

Would something as follows do what you want?

preg_replace('/(?<=href=")([^"]+)/', 'clicktrough.php?uri=$1', $source);


JW

[Back to original 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

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