Re: PHP function inside a regex - possible?
| From: | kev | Date: | Thu, 01 Jun 2000 18:12:59 +0000 |
| Subject: | Re: PHP function inside a regex - possible? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-849@lists.php.net to get a copy of this message | ||
Andreas Pour wrote:
> Hi, Kevin,
>
> As to your example, you have to have the replacement string be suitable
> for an "echo" statement, I think. The following works, anyway:
>
> $newtext = preg_replace("/(<B>(.*)<\/B>)/e", "\"<A
> href=\" . '\\2' .
> \"><B>\" .
> '\\2' . \"</B></A>\"", $text );
aaaahhhhhh, the penny drops! :)
thanks,
- Kev