Re: rewrite urls with preg_replace

From: Date: Fri, 29 Nov 2002 15:24:29 +0000
Subject: Re: rewrite urls with preg_replace
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-126478@lists.php.net to get a copy of this message
Hi Liljim, thanks very much, with the 'e' modifier and some quote-fixes it works well ! Dieter "Liljim" <liljim@liljim.co.uk> schrieb im Newsbeitrag news:20021128162237.12667.qmail@pb1.pair.com... > Hi Dieter, > > You need to use the 'e' modifier as well as 'is' in your pattern. Have a > look in the manual, here: > > http://www.php.net/manual/en/pcre.pattern.modifiers.php > > "If this modifier is set, preg_replace() does normal substitution of > backreferences in the replacement string, evaluates it as PHP code, and uses > the result for replacing the search string." > > Also look here: > http://www.php.net/manual/en/function.preg-replace.php > > And check the "Example 2. Using /e modifier" part. > > Hope that helps ;) > > James > > > "Dieter Koch" <dieter.koch@lhsystems.com> wrote in message > news:20021128122926.82026.qmail@pb1.pair.com... > > Hi to all the PHP-Fans out there, > > > > i have a syntax-problem with the folowing preg_replace command: > > > > $returnString = preg_replace("/(href=\")(.+?)(\")/is", > > preg_quote("\\1".ebLinkEncode(."\\2".)."\\3"), > > $returnString); > > > > i'm trying to call my own function within a preg_replace function and it > > won't work. > > any ideas ? it seems to me, that the quoting is incorrect, but i'm not > > shure, why it is incorrect, > > especially because i use preg_quote() ... > > > > thanks in advance for some hints ! > > > > best regards > > dieter.koch@lhsystems.com > > > > > > > > > > > >

« previous php.general (#126478) next »