preg_replace
| From: | Oliver Ruf | Date: | Thu, 04 Oct 2001 14:23:55 +0000 |
| Subject: | preg_replace | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-69920@lists.php.net to get a copy of this message | ||
Hello
I'm trying to write some kind of parser... see the example:
$text = "[LINK image.png]MyImage[/LINK]";
$out = preg_replace ("/\[LINK*\]*\[/LINK\]/i",
"/<a href=\"*\">*</a>/",$text);
Well... What I would like is, that $out would be something like about this:
"<a href="image.png">MyImage</a>"
But this somehow doesn't work because Regexp don't seem to be supported for
the replacement string...
Any idea ??
Thx, Oliver