Reply to Re: regular expression : {link}

Your name:

Reply:


Posted by Ac1d^ on 09/12/06 09:40

gehegeradeaus@gmail.com napisal(a):
> Can someone help me to make a regular expression for this sort of
> replacement :
>
> text with {link:pagehref}a link{/link}.
>
> replace to ->
>
> text with <a href="pagehref">a link</a>
>
> I tried several things but nothing seems to work... e.g.
>
> $value=preg_replace("/\{link\:(.+?)\}(.+?)\{\/link\}/s","<a href=\"$1\"
> target=\"_blank\">$2</a>",$value);
>
> Thanks in advance!

Try this pattern.
"/\{link\:(.*)\}(.*)\{\/link\}\s/"
rest of the code looks fine.

You can also have a look at the comments below preg-replace Description
at www.php.net. There is a lot of usefull informations how to use it,

http://uk2.php.net/manual/en/function.preg-replace.php

[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

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