I've recently taken a run at parsing links using php. I can't quite work out how to do it, so I'll just post what I'm trying to accomplish.
I have entries within a database, that include text and html. I've got that selected as $content.
I'm trying to get a function or set of functions to take this, and replace this:
withCode:<a href="http://myblog.com/">My Blog!</a>
I just need to work out how to parse the link from within href="" and move it to after [url= then close it with ]. After that take what was within the anchor tags and put it between the [ url=] and [ /url] tags.Code:[ url=http://myblog.com/]My Blog![ /url]
An ideas, or help?
Thanks everyone, Greatly appreciated.
Please ignore the spacing on the bb code, it was so that it would display on the forum.