Hello everyone what I want to achieve with php is to find a value in between two words (for all occurances) and replace this with another string, then remove the words around the value. Here's an example
$mysting = "[link]http://website.com[/link] bla bla bla bla [link]http://google.com[/link]";
What I want to achieve is make this string:
$newString = "<a href='http://website.com'>http://website.com</a> bla bla bla bla <a href='http://google.com'>http://google.com</a>";
How can I do this? This is what I have for now
preg_match("/(?<=[link])(.*)(?=[/link])/", $formData ,$match);
Thanks in advance!!