On Wed, 11 Jun 2003 14:53:13 +0100, Marios Adamantopoulos wrote: >[link][title]the link[/title][address]http://www.php.net[/address][/link] >And I need to change it to this: ><a href="http://www.php.net">the link</a>
Ewwww, fun.... try this :) <?PHP $in = '[link][title]the link[/title][address]http://www.php.net[/address][/link]'; $out = preg_replace( "|\[link\]\[title\]([^\[]*)\[/title\]\[address\]([^\[]*)\[/address\]\[/link\]|i", "<a href=\"$2\">$1</a>", $in ); echo "$in<BR>$out" ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php