I want to have my PHP page replace any instance of <link> with <a href=" and </link> with "</a>". This is so that if a URL is typed in the text file, the PHP page will know to hyperlink it automatically. So,
would translate to
I tried several variations of str_replace and preg_replace, but nothing was quite right. Any ideas?
Code:
<link>www.a.com</link>
Code:
<a href="[URL unfurl="true"]http://www.a.com"[/URL] target="_blank">www.a.com</a>
I tried several variations of str_replace and preg_replace, but nothing was quite right. Any ideas?