Hey all,
I have a string ($string for this example) and I want to do the following: Parse the string and convert all links within it to "actual links" (adding the open/close anchor tag) -- what is the best way to do this? I tried using preg_split() to create an array of the links contained in the string, with the idea of using str_replace() after the fact to make the changes. This approach isn't working however because I am having a hard time isolating the links in the string of text w/ preg_split().
$string could contain several links within it so thats why I was going with this approach. If I knew precisely what the links were ahead of time or if str_replace worked with pattern matching I would be set.
In short, I don't the approach described above as being the best way to go. What is a better method?
- Nicholas