I am trying to search through a string, find [link][/link] and turn it into a link. So if the string is:
This is a link: [link]http://www.yahoo.com[/link]
It would turn it into this:
This is a link: <a href="http://www.yahoo.com">http://www.yahoo.com</a>
How can this be done? I have this:
$string = ereg_replace ("[link](.*)[\/link]", "<a href=\"\"></a>", $string);
but I don't know how to get what was between the [link] tags and put it back into the string. Any help would be greatly appreciated. 🙂