I appreciate you guys and girls helping me. I know it's not nothing I'm asking here. But I would love to have this working on my site. So thanks to all who have a shot at it.
Here's what I want one more time.
I have a string called $html. This string always has alot of text in it and 1, 2 or 3 'href' links. These links are either:
- linked text: <a href="http://www.url.com">text</a>
- or linked url's: <a href="http://www.url.com">http://www.url.com</a>
In case of linked text, I would like to display this:
[http://www.url.com]text
In case of linked url, I would like to display this:
[http://www.url.com]
I'm not sure if just preg_replace would work though, as it has to check 'href' link up to 3 times and replace all 3 in a correct manner. However, i'm still hoping someone can come up with a wicked solution. Thank you for putting you time in this.
Yves